using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Data;
|
using System.Data.SqlClient;
|
using System.Windows.Forms;
|
using Pub_Class;
|
|
namespace APSM
|
{
|
public class Sc_ICMOSortBillFun
|
{
|
////ÖØÐ·ÖÅä²ð·Öµ¥ºÅ
|
//public static void RefreshCfBillNo(AxVSFlex7.AxVSFlexGrid grdMain, Int16 HICMoBillNoCol, Int16 HSplitNOCol)
|
//{
|
// List<string> sBillNo = new List<string>();
|
// if (grdMain.Rows == grdMain.FixedRows)
|
// {
|
// return;
|
// }
|
// //ÈÎÎñµ¥ ´æÈë
|
// sBillNo.Clear();
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (!sBillNo.Contains(DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HICMoBillNoCol))))//ÅжÏÊÇ·ñÖØ¸´
|
// {
|
// sBillNo.Add(DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HICMoBillNoCol)));
|
// }
|
// }
|
// //¸øÈÎÎñµ¥²ð·Ö
|
// int n = 0;
|
// foreach (string s in sBillNo)
|
// {
|
// n = 0;
|
// for (int r = grdMain.FixedRows; r < grdMain.Rows; r++)
|
// {
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(r, HICMoBillNoCol)) == s.Trim())
|
// {
|
// n++;
|
// grdMain.set_TextMatrix(r, HSplitNOCol, DBUtility.ClsPub.AscToChr(DBUtility.ClsPub.ChrToAsc("A") + (n - 1)));
|
// }
|
// }
|
// }
|
//}
|
//ÊÇ·ñÑ¡ÔñÁË µ¥Ôª¸ñ
|
//public static bool IsSelectCell(AxVSFlex7.AxVSFlexGrid grdMain ,int iRow, int iCol)
|
//{
|
// int iSelR = 0;
|
// int iSelC = 0;
|
// iSelR = grdMain.RowSel;
|
// iSelC = grdMain.ColSel;
|
// if (iRow >= grdMain.Row && iRow <= iSelR && iCol >= grdMain.Col && iCol <= iSelC)
|
// {
|
// return true;
|
// }
|
// if (iRow >= iSelR && iRow <= grdMain.Row && iCol >= iSelC && iCol <= grdMain.Col)
|
// {
|
// return true;
|
// }
|
// return false;
|
//}
|
|
//ÁÐÊÇ·ñÔÊÐí±à¼
|
//public static bool IsAllowEdit(AxVSFlex7.AxVSFlexGrid grdMain, int FixCols, int iRow, int iCol)
|
//{
|
// if (iRow < grdMain.FixedRows || iRow > (grdMain.Rows - 1))
|
// {
|
// return false;
|
// }
|
// if (iCol < grdMain.FixedCols || iCol > (grdMain.Cols - 1))
|
// {
|
// return false;
|
// }
|
// if (iCol >= FixCols && iCol <= (grdMain.Cols - 1))
|
// {
|
// return true;
|
// }
|
// return false;
|
//}
|
|
////¼ÓÔØ µ±ÔÂÈÕÆÚ
|
//public static void LoadDateCol(AxVSFlex7.AxVSFlexGrid grdMain, int FixCols, int iDates)
|
//{
|
// string bDate, eDate, dDate;
|
// grdMain.Cols = FixCols;
|
// bDate = DBUtility.ClsPub.GetServerDate(0);
|
// eDate = (DBUtility.ClsPub.isDate(bDate).AddDays(iDates)).ToShortDateString();
|
// dDate = bDate;
|
// //
|
// grdMain.Cols = grdMain.Cols + 1;
|
// dDate = (DBUtility.ClsPub.isDate(bDate).AddDays(0)).ToShortDateString();
|
// //
|
// grdMain.set_TextMatrix(0, grdMain.Cols - 1, Convert.ToDateTime(dDate).ToString("MM-dd"));
|
// grdMain.set_TextMatrix(1, grdMain.Cols - 1, Convert.ToDateTime(dDate).ToString("yyyy-MM-dd"));
|
// grdMain.set_ColData(grdMain.Cols - 1, Convert.ToDateTime(dDate).ToString("yyyy-MM-dd"));
|
// //
|
// for (int i = 1; i < iDates; i++)
|
// {
|
// if (dDate.CompareTo(eDate) > 0)
|
// return;
|
// grdMain.Cols = grdMain.Cols + 1;
|
// grdMain.set_ColWidth(grdMain.Cols - 1, 800);
|
// dDate = (DBUtility.ClsPub.isDate(bDate).AddDays(i)).ToShortDateString();
|
// grdMain.set_TextMatrix(0, grdMain.Cols - 1, Convert.ToDateTime(dDate).ToString("MM-dd"));
|
// grdMain.set_TextMatrix(1, grdMain.Cols - 1, Convert.ToDateTime(dDate).ToString("yyyy-MM-dd"));
|
// }
|
// grdMain.set_FixedAlignment(-1, VSFlex7.AlignmentSettings.flexAlignCenterCenter);
|
//}
|
|
//¼ÓÔØ µ±ÔÂÈÕÆÚ
|
public static void LoadDateCol(DataGridView grdMain, int FixCols, int iDates)
|
{
|
string bDate, eDate, dDate;
|
//grdMain.Cols = FixCols;
|
bDate = DBUtility.ClsPub.GetServerDate(0);
|
eDate = (DBUtility.ClsPub.isDate(bDate).AddDays(iDates)).ToShortDateString();
|
dDate = bDate;
|
//
|
grdMain.ColumnCount = grdMain.ColumnCount + 1;
|
dDate = (DBUtility.ClsPub.isDate(bDate).AddDays(0)).ToShortDateString();
|
grdMain.Columns[grdMain.ColumnCount - 1].Width =40;
|
//
|
grdMain.Columns[grdMain.ColumnCount - 1].HeaderText = Convert.ToDateTime(dDate).ToString("MM-dd");
|
grdMain.Columns[grdMain.ColumnCount - 1].Tag = Convert.ToDateTime(dDate).ToString("yyyy-MM-dd");
|
//grdMain.set_ColData(grdMain.Cols - 1, Convert.ToDateTime(dDate).ToString("yyyy-MM-dd"));
|
//
|
for (int i = 1; i < iDates; i++)
|
{
|
if (dDate.CompareTo(eDate) > 0)
|
return;
|
grdMain.ColumnCount = grdMain.ColumnCount + 1;
|
grdMain.Columns[grdMain.ColumnCount - 1].Width =40;
|
dDate = (DBUtility.ClsPub.isDate(bDate).AddDays(i)).ToShortDateString();
|
grdMain.Columns[grdMain.ColumnCount - 1].HeaderText = Convert.ToDateTime(dDate).ToString("MM-dd");
|
grdMain.Columns[grdMain.ColumnCount - 1].Tag = Convert.ToDateTime(dDate).ToString("yyyy-MM-dd");
|
//grdMain.set_TextMatrix(1, grdMain.Cols - 1, Convert.ToDateTime(dDate).ToString("yyyy-MM-dd"));
|
}
|
|
}
|
|
//¼ÓÔØ µ±ÔÂÈÕÆÚ
|
public static void LoadDateCol_Sec(DataGridView grdMain, int FixCols, int iDates)
|
{
|
string bDate, eDate, dDate;
|
//grdMain.Cols = FixCols;
|
bDate = DBUtility.ClsPub.GetServerDate(0);
|
eDate = (DBUtility.ClsPub.isDate(bDate).AddDays(iDates)).ToShortDateString();
|
dDate = bDate;
|
//
|
grdMain.ColumnCount = grdMain.ColumnCount + 1;
|
dDate = (DBUtility.ClsPub.isDate(bDate).AddDays(0)).ToShortDateString();
|
grdMain.Columns[grdMain.ColumnCount - 1].Width = 40;
|
//
|
grdMain.Columns[grdMain.ColumnCount - 1].HeaderText = Convert.ToDateTime(dDate).ToString("MM-dd");
|
grdMain.Columns[grdMain.ColumnCount - 1].Tag = "";
|
//grdMain.set_ColData(grdMain.Cols - 1, Convert.ToDateTime(dDate).ToString("yyyy-MM-dd"));
|
//
|
for (int i = 1; i < iDates; i++)
|
{
|
if (dDate.CompareTo(eDate) > 0)
|
return;
|
grdMain.ColumnCount = grdMain.ColumnCount + 1;
|
grdMain.Columns[grdMain.ColumnCount - 1].Width = 40;
|
dDate = (DBUtility.ClsPub.isDate(bDate).AddDays(i)).ToShortDateString();
|
grdMain.Columns[grdMain.ColumnCount - 1].HeaderText = Convert.ToDateTime(dDate).ToString("MM-dd");
|
grdMain.Columns[grdMain.ColumnCount - 1].Tag = "";
|
//grdMain.set_TextMatrix(1, grdMain.Cols - 1, Convert.ToDateTime(dDate).ToString("yyyy-MM-dd"));
|
}
|
|
}
|
|
////³õʼ»¯
|
//public static void initGrid(AxVSFlex7.AxVSFlexGrid grdMain, int FixCols)
|
//{
|
// grdMain.Rows = 2;
|
// grdMain.FixedRows = 2;
|
// grdMain.Cols = FixCols;
|
// grdMain.AllowBigSelection = true;
|
// grdMain.AllowSelection = true;
|
// grdMain.RowHeightMin = 300;
|
// grdMain.FixedCols = 0;
|
// grdMain.Editable = VSFlex7.EditableSettings.flexEDKbdMouse;
|
// grdMain.SelectionMode = VSFlex7.SelModeSettings.flexSelectionFree;
|
// grdMain.FocusRect = VSFlex7.FocusRectSettings.flexFocusSolid;
|
// grdMain.AllowUserResizing = VSFlex7.AllowUserResizeSettings.flexResizeColumns;
|
// grdMain.AllowUserFreezing = VSFlex7.AllowUserFreezeSettings.flexFreezeColumns;
|
// grdMain.set_FixedAlignment(-1, VSFlex7.AlignmentSettings.flexAlignCenterCenter);
|
// grdMain.ScrollTrack = true;
|
// grdMain.set_RowHeight(0, 650);
|
// grdMain.set_RowHidden(1, true);
|
// grdMain.WordWrap = true;
|
//}
|
////¼ì²é²ð·ÖÊýÁ¿µÄºÏÀíÐÔ
|
//public static bool CheckJHS(AxVSFlex7.AxVSFlexGrid grdMain, int HICMoBillNoCol, int HSplitPlanQtyCol, int HPlanQtyCol, int iRow)
|
//{
|
// string sBillNo;
|
// long iCount = 0;
|
// if (IsCf(grdMain, HICMoBillNoCol, iRow))
|
// {
|
// sBillNo = DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(iRow, HICMoBillNoCol));
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (sBillNo.Trim() == DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HICMoBillNoCol)))
|
// {
|
// iCount = iCount + DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HSplitPlanQtyCol));
|
// }
|
// }
|
// if (iCount > DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HPlanQtyCol)))
|
// {
|
// return false;
|
// }
|
// }
|
// return true;
|
//}
|
|
////ÊÇ·ñÑ¡Ôñ×ÊÔ´
|
//public static bool IsSelectZY(AxVSFlex7.AxVSFlexGrid grdMain, int HSourceIDCol)
|
//{
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HSourceIDCol)) == "")
|
// {
|
// return false;
|
// }
|
// }
|
// return true;
|
//}
|
|
////ÊÇ·ñÊǺÏÀíÐÐ
|
//public static bool AllowRow(AxVSFlex7.AxVSFlexGrid grdMain)
|
//{
|
// if (grdMain.Row >= grdMain.FixedRows && grdMain.Row <= grdMain.Rows - 1)
|
// {
|
// return true;
|
// }
|
// else
|
// {
|
// return false;
|
// }
|
//}
|
////ÅÅÐò
|
//public static bool SortData(AxVSFlex7.AxVSFlexGrid grdMain, int HSplitNOCol, int HICMoBillNoCol, int HPlanEndDateCol, int HPlanBeginDateCol, int HYXCol, int HSourceIDCol)
|
//{
|
// if (grdMain.Rows == grdMain.FixedRows)
|
// {
|
// return false;
|
// }
|
// grdMain.set_ColSort(HSplitNOCol, VSFlex7.SortSettings.flexSortStringAscending);
|
// grdMain.Select(grdMain.FixedRows, HSplitNOCol, grdMain.Rows - 1, HICMoBillNoCol);
|
// grdMain.Sort = VSFlex7.SortSettings.flexSortUseColSort;
|
// //
|
// grdMain.set_ColSort(HPlanEndDateCol, VSFlex7.SortSettings.flexSortStringAscending);
|
// grdMain.Select(grdMain.FixedRows, HPlanEndDateCol, grdMain.Rows - 1, HPlanEndDateCol);
|
// grdMain.Sort = VSFlex7.SortSettings.flexSortUseColSort;
|
// //
|
// grdMain.set_ColSort(HPlanBeginDateCol, VSFlex7.SortSettings.flexSortStringAscending);
|
// grdMain.Select(grdMain.FixedRows, HPlanBeginDateCol, grdMain.Rows - 1, HPlanBeginDateCol);
|
// grdMain.Sort = VSFlex7.SortSettings.flexSortUseColSort;
|
// //
|
// grdMain.set_ColSort(HYXCol, VSFlex7.SortSettings.flexSortNumericAscending);
|
// grdMain.Select(grdMain.FixedRows, HYXCol, grdMain.Rows - 1, HYXCol);
|
// grdMain.Sort = VSFlex7.SortSettings.flexSortUseColSort;
|
// //
|
// grdMain.set_ColSort(HSourceIDCol, VSFlex7.SortSettings.flexSortStringAscending);
|
// grdMain.Select(grdMain.FixedRows, HSourceIDCol, grdMain.Rows - 1, HSourceIDCol);
|
// grdMain.Sort = VSFlex7.SortSettings.flexSortUseColSort;
|
// grdMain.Select(0, 0);
|
// //
|
// return true;
|
//}
|
|
////»Ïß
|
//public static void GraphLine(AxVSFlex7.AxVSFlexGrid grdMain, int HSourceIDCol)
|
//{
|
// string stmp = "";
|
// int i = 0;
|
// int NextRow = 0;
|
// for (i = grdMain.FixedRows; i <= grdMain.Rows - grdMain.FixedRows; i++)
|
// {
|
// grdMain.Select(i, 0, i, grdMain.Cols - 1);
|
// grdMain.CellBorder(Convert.ToUInt32(DBUtility.ClsPub.Enum_Color.hx_Blue), 0, 0, 0, 1, 0, 0);
|
// }
|
// i = 0;
|
// stmp = DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HSourceIDCol));
|
// if (grdMain.FixedRows == grdMain.Rows)
|
// {
|
// return;
|
// }
|
// stmp = DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(grdMain.FixedRows, HSourceIDCol));
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// NextRow = GetNextRow(grdMain,i);
|
// if (NextRow == -1)
|
// {
|
// return;
|
// }
|
// if (i >= grdMain.FixedRows && i < grdMain.Rows - 1)
|
// {
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(NextRow, HSourceIDCol)) != stmp)
|
// {
|
// grdMain.Select(i, 0, i, grdMain.Cols - 1);
|
// grdMain.CellBorder(Convert.ToUInt32(DBUtility.ClsPub.Enum_Color.hx_Blue), 0, 0, 0, 2, 0, 0);
|
// }
|
// else
|
// {
|
// grdMain.Select(i, 0, i, grdMain.Cols - 1);
|
// grdMain.CellBorder(Convert.ToUInt32(DBUtility.ClsPub.Enum_Color.hx_Blue), 0, 0, 0, 0, 0, 0);
|
// }
|
// stmp = DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(NextRow, HSourceIDCol));
|
// }
|
// }
|
//}
|
|
////µÃµ½ÏÂÒ»¸ö ²»Òþ²ØµÄ ÐÐ
|
//public static int GetNextRow(AxVSFlex7.AxVSFlexGrid grdMain,int iRow)
|
//{
|
// for (int i = iRow + 1; i < grdMain.Rows; i++)
|
// {
|
// if (grdMain.get_RowHidden(i) == false)
|
// {
|
// return i;
|
// }
|
// }
|
// return -1;
|
//}
|
////Çå¿Õµ±ÈÕ
|
//public static void ClearCol(AxVSFlex7.AxVSFlexGrid grdMain,int FixCols, bool bAuto)
|
//{
|
// int i = 0;
|
// int m = 0;
|
// if (bAuto == false)
|
// {
|
// grdMain.Select(grdMain.FixedRows, FixCols, grdMain.Rows - 1, grdMain.Cols - 1);
|
// grdMain.Clear(VSFlex7.ClearWhereSettings.flexClearSelection, VSFlex7.ClearWhatSettings.flexClearText);
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, grdMain.FixedRows, FixCols, grdMain.Rows - 1, grdMain.Cols - 1, DBUtility.ClsPub.Enum_Color.hx_Black);
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, grdMain.FixedRows, FixCols, grdMain.Rows - 1, grdMain.Cols - 1, DBUtility.ClsPub.Enum_Color.hx_Write);
|
// grdMain.Select(0, 0);
|
// }
|
// else
|
// {
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// for (m = FixCols; m <= grdMain.Cols - 1; m++)
|
// {
|
// if (DBUtility.ClsPub.GridToColor(grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, m, i, m)) != DBUtility.ClsPub.Enum_Color.hx_Red)
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, i, m, i, m, DBUtility.ClsPub.Enum_Color.hx_Write);
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, m, i, m, DBUtility.ClsPub.Enum_Color.hx_Black);
|
// grdMain.set_TextMatrix(i, m, "");
|
// }
|
// }
|
// }
|
// }
|
//}
|
//Çå¿ÕÈÕÆÚÁÐ
|
//public static void ClearDateCol(AxVSFlex7.AxVSFlexGrid grdMain,int FixCols, bool bClear)
|
//{
|
// int i = 0;
|
// if (!(grdMain.Col >= FixCols && grdMain.Col <= grdMain.Cols - 1))
|
// {
|
// return;
|
// }
|
// if (bClear == true)
|
// {
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// grdMain.set_TextMatrix(i, grdMain.Col, "0");
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, grdMain.Col, i, grdMain.Col, DBUtility.ClsPub.Enum_Color.hx_Red);
|
// }
|
// }
|
// else
|
// {
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// grdMain.set_TextMatrix(i, grdMain.Col, "");
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, grdMain.Col, i, grdMain.Col, DBUtility.ClsPub.Enum_Color.hx_Black);
|
// }
|
// }
|
//}
|
|
////ÉèÖÃÊÖ¹¤Ð޸ıê¼Ç
|
//public static void Sub_SetHandChangeFlag(AxVSFlex7.AxVSFlexGrid grdMain,int sCol,int sRow)
|
//{
|
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, sRow, sCol, sRow, sCol, DBUtility.ClsPub.Enum_Color.hx_Red);
|
|
//}
|
|
////Ëø¶¨ÈÕÆÚÁÐ
|
//public static void LockDateCol(AxVSFlex7.AxVSFlexGrid grdMain, int FixCols, bool bClear)
|
//{
|
// int i = 0;
|
// if (!(grdMain.Col >= FixCols && grdMain.Col <= grdMain.Cols - 1))
|
// {
|
// return;
|
// }
|
// if (grdMain.Row < grdMain.FixedCols || grdMain.RowSel < grdMain.FixedCols)
|
// {
|
// return;
|
// }
|
// int BRow = 0;
|
// int ERow = 0;
|
// if (grdMain.Row < grdMain.RowSel)
|
// {
|
// BRow = grdMain.Row;
|
// ERow = grdMain.RowSel;
|
// }
|
// else
|
// {
|
// BRow = grdMain.RowSel;
|
// ERow = grdMain.Row;
|
// }
|
// if (bClear == true)
|
// {
|
// for (i = BRow; i <= ERow; i++)
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, grdMain.Col, i, grdMain.Col, DBUtility.ClsPub.Enum_Color.hx_Red);
|
// }
|
// }
|
// else
|
// {
|
// for (i = BRow; i <= ERow; i++)
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, grdMain.Col, i, grdMain.Col, DBUtility.ClsPub.Enum_Color.hx_Black);
|
// }
|
// }
|
//}
|
//ÔÊÐí±à¼
|
public static bool AllowEdit(int FixCols, int sCol, string sAllowCol)
|
{
|
if (sCol < FixCols)
|
{
|
if (sAllowCol.Contains("," + sCol.ToString() + ",") != true)
|
{
|
return true;
|
}
|
}
|
return false;
|
}
|
////¼ì²é×ÊÔ´ºÏÀíÐÔ
|
//public static bool CheckSource(AxVSFlex7.AxVSFlexGrid grdMain, int HICMoBillNoCol, int HSourceIDCol,ref int n)
|
//{
|
// for (int i = grdMain.FixedRows; i <= grdMain.Rows; i++)
|
// {
|
// for (int j = i + 1; j <= grdMain.Rows - 1; j++)
|
// {
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HICMoBillNoCol)) == DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(j, HICMoBillNoCol)))
|
// {
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HSourceIDCol)) == DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(j, HSourceIDCol)))
|
// {
|
// n = j;
|
// return false;
|
// }
|
// }
|
// }
|
// }
|
// return true;
|
//}
|
//µÃµ½µÃµ½±¾¹¤Ðò µ±ÈÕÉϰàʱ¼ä
|
public static double GetWorkNumber(string FDate, long SourceID, SQLHelper.ClsCN oCn)
|
{
|
double lWorkNumber = 0;
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetSourceWorkTimes '" + FDate + "'," + SourceID.ToString(), "Gy_PlanShifts");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
lWorkNumber = 8;
|
}
|
else
|
{
|
lWorkNumber = DBUtility.ClsPub.isDoule(oDs.Tables[0].Rows[0]["¹¤Ê±"]);
|
}
|
//
|
return lWorkNumber;
|
}
|
////ÅжϲÎÊýÐÐÊÇ·ñ²ð·Ö¹ý
|
//public static bool IsCf(AxVSFlex7.AxVSFlexGrid grdMain, int HICMoBillNoCol, int iRow)
|
//{
|
// string sBillNo = DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(iRow, HICMoBillNoCol));
|
// int intCount = 0;
|
// int i = 0;
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (sBillNo.Trim().ToUpper() == DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HICMoBillNoCol)).Trim().ToUpper())
|
// {
|
// intCount++;
|
// }
|
// }
|
// if (intCount > 1)
|
// {
|
// return true;
|
// }
|
// return false;
|
//}
|
//½»»õÆÚ ³¬ÆÚʱ ±äÉ«
|
//public static void AddColor(AxVSFlex7.AxVSFlexGrid grdMain, int HPlanEndDateCol, int FixCols)
|
//{
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, HPlanEndDateCol, i, HPlanEndDateCol, DBUtility.ClsPub.Enum_Color.hx_Black);
|
// for (int m = grdMain.Cols - 1; m >= FixCols; m--)
|
// {
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, m)) != "")
|
// {
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(1, m)).CompareTo(DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HPlanEndDateCol))) > 0)
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, HPlanEndDateCol, i, HPlanEndDateCol, DBUtility.ClsPub.Enum_Color.hx_Red);
|
// }
|
|
// }
|
// }
|
// }
|
//}
|
//¼ÓÔØ×Ó±í
|
//public static void SetSubGrid(AxVSFlex7.AxVSFlexGrid grdMain, Model.ClsSc_ICMOSortBillMain oModel,ref int c,ref int i, int FixCols)
|
//{
|
// c = FixCols - 1;
|
// foreach (Model.ClsSc_ICMOSortBillSub oSub in oModel.DetailColl)
|
// {
|
// if (c <= grdMain.Cols - 1)
|
// {
|
// for (c = c; c < grdMain.Cols; c++)
|
// {
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(1, c)) == oSub.HDate.ToShortDateString())
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, i, c, i, c, oSub.HiBackColor);
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, c, i, c, oSub.HiForeColor);
|
// if (oSub.HQty != 0)
|
// {
|
// grdMain.set_TextMatrix(i, c, oSub.HQty.ToString());
|
// }
|
// else
|
// {
|
// grdMain.set_TextMatrix(i, c, "");
|
// }
|
// break;
|
// }
|
// }
|
// }
|
// }
|
//}
|
|
////¼ÓÔØ×Ó±í
|
//public static void SetSubGrid(AxVSFlex7.AxVSFlexGrid grdMain, Model.ClsSc_ProcPlanSortBillMain oModel, ref int c, ref int i, int FixCols)
|
//{
|
// c = FixCols - 1;
|
// foreach (Model.ClsSc_ProcPlanSortBillSub oSub in oModel.DetailColl)
|
// {
|
// if (c <= grdMain.Cols - 1)
|
// {
|
// for (c = c; c < grdMain.Cols; c++)
|
// {
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(1, c)) == oSub.HDate.ToShortDateString())
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, i, c, i, c, oSub.HiBackColor);
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, c, i, c, oSub.HiForeColor);
|
// if (oSub.HQty != 0)
|
// {
|
// grdMain.set_TextMatrix(i, c, oSub.HQty.ToString());
|
// }
|
// else
|
// {
|
// grdMain.set_TextMatrix(i, c, "");
|
// }
|
// break;
|
// }
|
// }
|
// }
|
// }
|
//}
|
|
|
|
//¼ÓÔØ×Ó±í
|
public static void SetSubGrid(DataGridView grdMain, DAL.ClsSc_WorkBillAutoSortBill oMain, ref int c, ref int i, int FixCols)
|
{
|
c = FixCols - 1;
|
foreach (Model.ClsSc_WorkBillAutoSortBillSub oSub in oMain.DetailColl)
|
{
|
if (c <= grdMain.ColumnCount - 1)
|
{
|
for (int m = c; m < grdMain.ColumnCount; m++)
|
{
|
if (DBUtility.ClsPub.isStrNull(grdMain.Columns[m].HeaderText) == oSub.HDate.ToShortDateString().Substring(5,5)
|
)
|
{
|
//grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, i, c, i, c, oSub.HiBackColor);
|
//grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, c, i, c, oSub.HiForeColor);
|
if (oSub.HQty != 0)
|
{
|
grdMain.Rows[i].Cells[m].Value = oSub.HQty.ToString();
|
}
|
else
|
{
|
grdMain.Rows[i].Cells[m].Value = "";
|
}
|
break;
|
}
|
}
|
}
|
}
|
}
|
|
//¼ÓÔØÊ±¼ä×Ó±í
|
public static void SetSubGrid_t(DataGridView grdMain, DAL.ClsSc_WorkBillAutoSortBill oMain, ref int c, ref int i, int FixCols)
|
{
|
c = FixCols - 1;
|
i = 0;
|
foreach (Model.ClsSc_WorkBillAutoSortBillSub oSub in oMain.DetailColl)
|
{
|
for (int j = 0; j < grdMain.Rows.Count; j++)
|
{
|
if (DBUtility.ClsPub.isLong(grdMain.Rows[j].Cells[FixCols - 1].Value) == oSub.HInterID)
|
{
|
if (c <= grdMain.ColumnCount - 1)
|
{
|
for (int m = c; m < grdMain.ColumnCount; m++)
|
{
|
if (DBUtility.ClsPub.isStrNull(grdMain.Columns[m].Tag) == oSub.HDate.ToShortDateString())
|
{
|
//grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, i, c, i, c, oSub.HiBackColor);
|
//grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, c, i, c, oSub.HiForeColor);
|
if (oSub.HQty != 0)
|
{
|
grdMain.Rows[j].Cells[m].Value = oSub.HBTimes.ToShortTimeString() + "-" + oSub.HETimes.ToShortTimeString();
|
}
|
else
|
{
|
grdMain.Rows[j].Cells[m].Value = "";
|
}
|
break;
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
|
/////////////////////////////////////////////////////////
|
|
//±£´æ×Ó±í
|
public static void SaveGridSub(DataGridView grdMain, DataGridView grdMain_t, int FixCols, DAL.ClsSc_WorkBillAutoSortBill oBill, DateTime sDate, double dWorkQty, ref int i, List<ClsGridValues> oClsGridValues)
|
{
|
string HBTimes;
|
string HETimes;
|
string sStr;
|
char ch = Convert.ToChar("-");
|
string[] s;
|
if (i < 0)
|
{
|
return;
|
}
|
for (int c = FixCols; c <= grdMain.ColumnCount - 1; c++)
|
{
|
|
if (DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[c].Value) != 0)
|
{
|
//×Ó±í¸³Öµ
|
Model.ClsSc_WorkBillAutoSortBillSub oSub = new Model.ClsSc_WorkBillAutoSortBillSub();
|
oSub.HEntryID = c;
|
oSub.HMasterDate = sDate;
|
oSub.HDate = DBUtility.ClsPub.isDate(grdMain.Columns[c].HeaderText);
|
oSub.HQty = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[c].Value);
|
oSub.HTimes = 0;
|
if (dWorkQty != 0)
|
{
|
oSub.HUseTimes = oSub.HQty / dWorkQty;
|
}
|
else
|
{
|
oSub.HUseTimes = 0;
|
}
|
oSub.HStatusTag = 0;
|
//
|
foreach(ClsGridValues oSubvalues in oClsGridValues)
|
{
|
if (oSubvalues.iRow == i && oSubvalues.iCol == c)
|
{
|
oSub.HTimes = oSubvalues.HLeftTimes;
|
oSub.HBTimes = oSubvalues.HBeginTime;
|
oSub.HETimes = oSubvalues.HEndTime;
|
oSub.HChangeTimes = oSubvalues.HChangeTimes;
|
oSub.HInStockDays = oSubvalues.HInStockDays;
|
}
|
}
|
oSub.HRemark = "";
|
//
|
oBill.DetailColl.Add(oSub);
|
}
|
}
|
}
|
|
//±£´æ×Ó±í
|
public static void SaveGridSub(DataGridView grdMain, DataGridView grdMain_t, int FixCols, DAL.ClsSc_WorkBillMonthSortBill oBill, DateTime sDate, double dWorkQty, ref int i, List<ClsGridValues> oClsGridValues)
|
{
|
string HBTimes;
|
string HETimes;
|
string sStr;
|
char ch = Convert.ToChar("-");
|
string[] s;
|
if (i < 0)
|
{
|
return;
|
}
|
for (int c = FixCols; c <= grdMain.ColumnCount - 1; c++)
|
{
|
|
if (DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[c].Value) != 0)
|
{
|
//×Ó±í¸³Öµ
|
Model.ClsSc_WorkBillMonthSortBillSub oSub = new Model.ClsSc_WorkBillMonthSortBillSub();
|
oSub.HEntryID = c;
|
oSub.HMasterDate = sDate;
|
oSub.HDate = DBUtility.ClsPub.isDate(grdMain.Columns[c].HeaderText);
|
oSub.HQty = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[c].Value);
|
oSub.HTimes = 0;
|
if (dWorkQty != 0)
|
{
|
oSub.HUseTimes = oSub.HQty / dWorkQty;
|
}
|
else
|
{
|
oSub.HUseTimes = 0;
|
}
|
oSub.HStatusTag = 0;
|
//
|
foreach (ClsGridValues oSubvalues in oClsGridValues)
|
{
|
if (oSubvalues.iRow == i && oSubvalues.iCol == c)
|
{
|
oSub.HTimes = oSubvalues.HLeftTimes;
|
oSub.HBTimes = oSubvalues.HBeginTime;
|
oSub.HETimes = oSubvalues.HEndTime;
|
//oSub.HChangeTimes = oSubvalues.HChangeTimes;
|
}
|
}
|
oSub.HRemark = "";
|
//
|
oBill.DetailColl.Add(oSub);
|
}
|
}
|
}
|
|
////ºÏ²¢ÈÎÎñµ¥
|
//public static void HBData(AxVSFlex7.AxVSFlexGrid grdMain, int HSelectCol, int lngCol, int HMaterIDCol, int HSourceIDCol, Int64 HProcID, int HWorkQtyCol, DAL.ClsSc_ICMOSortBill oMain)
|
//{
|
// int i;
|
// int SelectRow = 0;
|
// string s = "";
|
// //
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (DBUtility.ClsPub.GridToBool(grdMain.get_TextMatrix(i, HSelectCol)) == true)
|
// {
|
// SelectRow = i;
|
// RefreshWorkQty(grdMain, HMaterIDCol,HSourceIDCol, HProcID, HWorkQtyCol,oMain);
|
// break;
|
// }
|
// }
|
// for (i = grdMain.Rows - 1; i >= grdMain.FixedRows; i--)
|
// {
|
// if (DBUtility.ClsPub.GridToBool(grdMain.get_TextMatrix(i, HSelectCol)) == true
|
// && i != SelectRow)
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(SelectRow, lngCol)) + DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, lngCol)));
|
// grdMain.set_TextMatrix(SelectRow, lngCol, s);
|
// grdMain.RemoveItem(i);
|
// break;
|
// }
|
// }
|
// return;
|
//}
|
|
//ºÏ²¢ÈÎÎñµ¥
|
//public static void HBData(AxVSFlex7.AxVSFlexGrid grdMain, int HSelectCol, int lngCol, int HMaterIDCol, int HSourceIDCol, Int64 HProcID, int HWorkQtyCol, DAL.ClsSc_ProcPlanSortBill oMain)
|
//{
|
// int i;
|
// int SelectRow = 0;
|
// string s = "";
|
// //
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (DBUtility.ClsPub.GridToBool(grdMain.get_TextMatrix(i, HSelectCol)) == true)
|
// {
|
// SelectRow = i;
|
// RefreshWorkQty(grdMain, HMaterIDCol, HSourceIDCol, HProcID, HWorkQtyCol, oMain);
|
// break;
|
// }
|
// }
|
// for (i = grdMain.Rows - 1; i >= grdMain.FixedRows; i--)
|
// {
|
// if (DBUtility.ClsPub.GridToBool(grdMain.get_TextMatrix(i, HSelectCol)) == true
|
// && i != SelectRow)
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(SelectRow, lngCol)) + DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, lngCol)));
|
// grdMain.set_TextMatrix(SelectRow, lngCol, s);
|
// grdMain.RemoveItem(i);
|
// break;
|
// }
|
// }
|
// return;
|
//}
|
////Ë¢ÐÂÈ«²¿×ÊÔ´ ²úÄÜ
|
//public static void RefreshWorkQty(AxVSFlex7.AxVSFlexGrid grdMain, int HMaterIDCol, int HSourceIDCol, Int64 HProcID, int HWorkQtyCol,DAL.ClsSc_ICMOSortBill oMain)
|
//{
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HSourceIDCol)) != 0)
|
// {
|
// SetSourceWorkQty(grdMain, HMaterIDCol, HSourceIDCol, HProcID, HWorkQtyCol, i,oMain);
|
// }
|
// }
|
//}
|
////Ë¢ÐÂÈ«²¿×ÊÔ´ ²úÄÜ
|
//public static void RefreshWorkQty(AxVSFlex7.AxVSFlexGrid grdMain, int HMaterIDCol, int HSourceIDCol, Int64 HProcID, int HWorkQtyCol, DAL.ClsSc_ProcPlanSortBill oMain)
|
//{
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HSourceIDCol)) != 0)
|
// {
|
// SetSourceWorkQty(grdMain, HMaterIDCol, HSourceIDCol, HProcID, HWorkQtyCol, i, oMain);
|
// }
|
// }
|
//}
|
|
////ÉèÖñ¾ÐÐ ×ÊÔ´£¬²úÄÜ£¬²ð·Ö»ã±¨ÊýÁ¿
|
//public static void SetSourceWorkQty(AxVSFlex7.AxVSFlexGrid grdMain, int HMaterIDCol, int HSourceIDCol, Int64 HProcID, int HWorkQtyCol, int iRow,DAL.ClsSc_ICMOSortBill oMain)
|
//{
|
// Single WorkQty = 0;
|
// WorkQty = oMain.GetSourceWorkQty(DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HMaterIDCol))
|
// , HProcID
|
// , DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HSourceIDCol)));
|
// //
|
// grdMain.set_TextMatrix(iRow, HWorkQtyCol, WorkQty.ToString());
|
//}
|
|
|
//ÉèÖñ¾ÐÐ ×ÊÔ´£¬²úÄÜ£¬²ð·Ö»ã±¨ÊýÁ¿
|
public static void SetSourceWorkQty(DataGridView grdMain, int HMaterIDCol, int HSourceIDCol, Int64 HProcID, int HWorkQtyCol, int iRow, DAL.ClsSc_WorkBillAutoSortBill oMain)
|
{
|
Single WorkQty = 0;
|
WorkQty = oMain.GetSourceWorkQty(DBUtility.ClsPub.isLong(grdMain.Rows[iRow].Cells[HMaterIDCol].Value)
|
, HProcID
|
, DBUtility.ClsPub.isLong(grdMain.Rows[iRow].Cells[HSourceIDCol].Value),true);
|
//
|
grdMain.Rows[iRow].Cells[HWorkQtyCol].Value = WorkQty.ToString();
|
}
|
|
//ÉèÖñ¾ÐÐ ×ÊÔ´£¬²úÄÜ
|
public static void SetLineSourceWorkQty(DataGridView grdMain, int HMaterIDCol, int HSourceIDCol, Int64 HProcID, int HWorkQtyCol, int iRow, DAL.ClsSc_WorkBillAutoSortBill oMain)
|
{
|
Single WorkQty = 0;
|
WorkQty = oMain.GetLineSourceWorkQty(DBUtility.ClsPub.isLong(grdMain.Rows[iRow].Cells[HMaterIDCol].Value)
|
, HProcID
|
, DBUtility.ClsPub.isLong(grdMain.Rows[iRow].Cells[HSourceIDCol].Value), true);
|
//
|
grdMain.Rows[iRow].Cells[HWorkQtyCol].Value = WorkQty.ToString();
|
}
|
|
////ÉèÖñ¾ÐÐ ×ÊÔ´£¬²úÄÜ£¬²ð·Ö»ã±¨ÊýÁ¿
|
//public static void SetSourceWorkQty(AxVSFlex7.AxVSFlexGrid grdMain, int HMaterIDCol, int HSourceIDCol, Int64 HProcID, int HWorkQtyCol, int iRow, DAL.ClsSc_ProcPlanSortBill oMain)
|
//{
|
// Single WorkQty = 0;
|
// WorkQty = oMain.GetSourceWorkQty(DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HMaterIDCol))
|
// , HProcID
|
// , DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HSourceIDCol)));
|
// //
|
// grdMain.set_TextMatrix(iRow, HWorkQtyCol, WorkQty.ToString());
|
//}
|
|
////ÉèÖñ¾ÐÐ ×ÊÔ´ £¬²ð·Ö»ã±¨ÊýÁ¿
|
//public static void SetSourceRelationQty(AxVSFlex7.AxVSFlexGrid grdMain, int iRow, int HICMOInterIDCol, int HSourceIDCol, int HRelationQtyCol, int HSplitRelationQtyCol, DAL.ClsSc_ICMOSortBill oMain)
|
//{
|
// Single RelationQty = 0;
|
// Single SplitRelationQty = 0;
|
// oMain.GetSourceRelationQty(DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HICMOInterIDCol))
|
// , DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HSourceIDCol)), ref RelationQty, ref SplitRelationQty);
|
// //
|
// grdMain.set_TextMatrix(iRow, HRelationQtyCol, RelationQty.ToString());
|
// grdMain.set_TextMatrix(iRow, HSplitRelationQtyCol, SplitRelationQty.ToString());
|
//}
|
|
//ÉèÖñ¾ÐÐ ×ÊÔ´ £¬²ð·Ö»ã±¨ÊýÁ¿
|
public static void SetSourceRelationQty(DataGridView grdMain, int iRow, int HICMOInterIDCol, int HSourceIDCol, int HRelationQtyCol, int HSplitRelationQtyCol, DAL.ClsSc_WorkBillAutoSortBill oMain)
|
{
|
Single RelationQty = 0;
|
Single SplitRelationQty = 0;
|
oMain.GetSourceRelationQty(DBUtility.ClsPub.isLong(grdMain.Rows[iRow].Cells[HICMOInterIDCol].Value)
|
, DBUtility.ClsPub.isLong(grdMain.Rows[iRow].Cells[HSourceIDCol].Value), ref RelationQty, ref SplitRelationQty);
|
//
|
grdMain.Rows[iRow].Cells[HRelationQtyCol].Value = RelationQty.ToString();
|
//grdMain.set_TextMatrix(iRow, HSplitRelationQtyCol, SplitRelationQty.ToString());
|
}
|
|
////ÉèÖñ¾ÐÐ ×ÊÔ´ £¬²ð·Ö»ã±¨ÊýÁ¿
|
//public static void SetSourceRelationQty(AxVSFlex7.AxVSFlexGrid grdMain, int iRow, int HICMOInterIDCol, int HSourceIDCol, int HRelationQtyCol, int HSplitRelationQtyCol, DAL.ClsSc_ProcPlanSortBill oMain)
|
//{
|
// Single RelationQty = 0;
|
// Single SplitRelationQty = 0;
|
// oMain.GetSourceRelationQty(DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HICMOInterIDCol))
|
// , DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HSourceIDCol)), ref RelationQty, ref SplitRelationQty);
|
// //
|
// grdMain.set_TextMatrix(iRow, HRelationQtyCol, RelationQty.ToString());
|
// grdMain.set_TextMatrix(iRow, HSplitRelationQtyCol, SplitRelationQty.ToString());
|
//}
|
|
|
////ÊÇ·ñÑ¡ÖÐÐÐ ºÏ²¢
|
//public static bool ExistCell(AxVSFlex7.AxVSFlexGrid grdMain, int HSelectCol)
|
//{
|
// int i = 0, SelectRows = 0;
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (DBUtility.ClsPub.GridToBool(grdMain.get_TextMatrix(i, HSelectCol)) == true)
|
// {
|
// SelectRows++;
|
// }
|
// }
|
// if (SelectRows > 0)
|
// {
|
// return true;
|
// }
|
// return false;
|
//}
|
////ÊÇ·ñÔÊÐí ²ð·Ö
|
//public static bool AllowCF(AxVSFlex7.AxVSFlexGrid grdMain, int HSelectCol)
|
//{
|
// int SelectRows = 0;
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (DBUtility.ClsPub.GridToBool(grdMain.get_TextMatrix(i, HSelectCol)) == true)
|
// {
|
// SelectRows++;
|
// }
|
// }
|
// if (SelectRows == 1)
|
// {
|
// return true;
|
// }
|
// return false;
|
//}
|
////ÊÇ·ñ ÔÊÐíºÏ²¢
|
//public static bool AllowHB(AxVSFlex7.AxVSFlexGrid grdMain, int HSelectCol, int HICMoBillNoCol)
|
//{
|
// string sICBillNo = "";
|
// int i = 0, SelectRows = 0;
|
// bool b = false;
|
// if (ExistCell(grdMain,HSelectCol))
|
// {
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (DBUtility.ClsPub.GridToBool(grdMain.get_TextMatrix(i, HSelectCol)))
|
// {
|
// SelectRows++;
|
// }
|
// }
|
// //
|
// if (SelectRows > 1)
|
// {
|
// for (i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (DBUtility.ClsPub.GridToBool(grdMain.get_TextMatrix(i, HSelectCol)) == true)
|
// {
|
// if (b == false)
|
// {
|
// sICBillNo = DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HICMoBillNoCol));
|
// b = true;
|
// }
|
// if (sICBillNo.Trim().ToUpper() != DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(i, HICMoBillNoCol).ToUpper())
|
// && b == true)
|
// {
|
// return false;
|
// }
|
|
// }
|
// }
|
// return true;
|
// }
|
// }
|
|
// return false;
|
//}
|
////±£´æ×Ó±í
|
//public static void SaveGridSub(AxVSFlex7.AxVSFlexGrid grdMain, int FixCols, Model.ClsSc_ICMOSortBillMain oModel,DateTime sDate,ref int i)
|
//{
|
// for (int c = FixCols; c <= grdMain.Cols - 1; c++)
|
// {
|
// if (DBUtility.ClsPub.isDoule(grdMain.get_ValueMatrix(i, c)) != 0)
|
// {
|
// //×Ó±í¸³Öµ
|
// Model.ClsSc_ICMOSortBillSub oSub = new Model.ClsSc_ICMOSortBillSub();
|
// oSub.HEntryID = c;
|
// oSub.HMasterDate = sDate;
|
// oSub.HDate = DBUtility.ClsPub.isDate(grdMain.get_TextMatrix(grdMain.FixedRows - 2, c));
|
// oSub.HQty = DBUtility.ClsPub.isDoule(grdMain.get_ValueMatrix(i, c));
|
// oSub.HStatusTag = 0;
|
// oSub.HiForeColor = grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, c, i, c).ToString();
|
// oSub.HiBackColor = grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, i, c, i, c).ToString();
|
// oSub.HRemark = "";
|
// //
|
// oModel.DetailColl.Add(oSub);
|
// }
|
// }
|
//}
|
////±£´æ×Ó±í
|
//public static void SaveGridSub(AxVSFlex7.AxVSFlexGrid grdMain, int FixCols, Model.ClsSc_ProcPlanSortBillMain oModel, DateTime sDate, ref int i)
|
//{
|
// for (int c = FixCols; c <= grdMain.Cols - 1; c++)
|
// {
|
// if (DBUtility.ClsPub.isDoule(grdMain.get_ValueMatrix(i, c)) != 0)
|
// {
|
// //×Ó±í¸³Öµ
|
// Model.ClsSc_ProcPlanSortBillSub oSub = new Model.ClsSc_ProcPlanSortBillSub();
|
// oSub.HEntryID = c;
|
// oSub.HMasterDate = sDate;
|
// oSub.HDate = DBUtility.ClsPub.isDate(grdMain.get_TextMatrix(grdMain.FixedRows - 2, c));
|
// oSub.HQty = DBUtility.ClsPub.isDoule(grdMain.get_ValueMatrix(i, c));
|
// oSub.HStatusTag = 0;
|
// oSub.HiForeColor = grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, c, i, c).ToString();
|
// oSub.HiBackColor = grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, i, c, i, c).ToString();
|
// oSub.HRemark = "";
|
// //
|
// oModel.DetailColl.Add(oSub);
|
// }
|
// }
|
//}
|
////¼ÆËãÿÈÕ¼Ó¹¤Ê±¼ä
|
//public static double CountDayHours(AxVSFlex7.AxVSFlexGrid grdMain, int iRow, int iCol, int HMaterIDCol, int HSourceIDCol, int HYXCol, int HReadyTimesCol,SQLHelper.ClsCN oCn)
|
//{
|
// double cTimes = 0;
|
// if (DBUtility.ClsPub.isDoule(grdMain.get_ColData(iCol)) > 0)
|
// {
|
// if (DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HMaterIDCol)) == DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow - 1, HMaterIDCol))
|
// && DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HSourceIDCol)) == DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow - 1, HSourceIDCol))
|
// && DBUtility.ClsPub.isDoule(grdMain.get_ColData(iCol)) != GetWorkNumber(DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(1, iCol)), DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HSourceIDCol)), oCn)
|
// && (DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HYXCol)) != DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow - 1, HYXCol))
|
// || DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HYXCol)) == 0))
|
// {
|
// cTimes = DBUtility.ClsPub.isDoule(grdMain.get_ColData(iCol)) - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(iRow, HReadyTimesCol));
|
// grdMain.set_ColData(iCol, cTimes.ToString());
|
// }
|
// else if (DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HSourceIDCol)) != DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow - 1, HSourceIDCol))
|
// && DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow, HYXCol)) != DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iRow - 1, HYXCol)))
|
// {
|
// cTimes = DBUtility.ClsPub.isDoule(grdMain.get_ColData(iCol)) - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(iRow, HReadyTimesCol));
|
// grdMain.set_ColData(iCol, cTimes.ToString());
|
// }
|
// else
|
// {
|
// cTimes = DBUtility.ClsPub.isDoule(grdMain.get_ColData(iCol));
|
// }
|
// }
|
// //
|
// if (cTimes < 0)
|
// {
|
// return 0;
|
// }
|
// else
|
// {
|
// return cTimes;
|
// }
|
//}
|
|
////ÅųÌ2
|
//public static bool CountDateSetup(AxVSFlex7.AxVSFlexGrid grdMain, int iBeginRow, int iEndRow, int FixCols, int HSourceIDCol, int HWorkQtyCol, int HSplitPlanQtyCol, int HSplitRelationQtyCol, int HPlanQtyCol, int HRelationQtyCol, int HICMoBillNoCol, int HPlanBeginDateCol, int HKTQCol, int HYXCol, int HPlanEndDateCol, int HMaterIDCol, int HReadyTimesCol,long HSourceID,SQLHelper.ClsCN oCn)
|
//{
|
// double HourQuan = 0, SYHours = 0;
|
// double SYQuan = 0;
|
// string bDate = "", CurDate = "";
|
// int i = 0, m;
|
// string s;
|
// int lJHSCol, lWGSCol;
|
// for (m = FixCols; m < grdMain.Cols; m++)
|
// {
|
// grdMain.set_ColData(m, GetWorkNumber(DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(1, m)), DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iBeginRow, HSourceIDCol)),oCn));//ÉèÖà ×ÜÉϰàʱ¼ä
|
// }
|
// for (i = iBeginRow; i <= iEndRow; i++)//ÉèÖà Éϰàʱ¼ä
|
// {
|
// for (m = FixCols; m < grdMain.Cols; m++)
|
// {
|
// HourQuan = CountHourQuantity(grdMain,i, m,HWorkQtyCol);//µÃµ½ Сʱ ²úÄÜ
|
// if (DBUtility.ClsPub.GridToColor(grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, m, i, m)) == DBUtility.ClsPub.Enum_Color.hx_Red && DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, m)) != 0)
|
// {
|
// if (HourQuan != 0)//·ÀÖ¹ ³ýÊý Ϊ0
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, m)) / HourQuan);
|
// grdMain.set_ColData(m, s);
|
// }
|
// }
|
|
// }
|
// }
|
// //
|
// for (i = iBeginRow; i <= iEndRow; i++)
|
// {
|
// if (grdMain.get_RowHidden(i) == false)
|
// {
|
// if (IsCf(grdMain,HICMoBillNoCol, i))//¸ù¾ÝÊÇ·ñ²ð·Ö À´µÃµ½ ¶ÔÓ¦ÁÐ
|
// {
|
// lJHSCol = HSplitPlanQtyCol;
|
// lWGSCol = HSplitRelationQtyCol;
|
// }
|
// else
|
// {
|
// lJHSCol = HPlanQtyCol;
|
// lWGSCol = HRelationQtyCol;
|
// }
|
// SYQuan = DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, lJHSCol)) - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, lWGSCol));//µÃµ½ Ê£ÓàÊýÁ¿
|
// //
|
// for (m = FixCols; m < grdMain.Cols; m++)
|
// {
|
// HourQuan = CountHourQuantity(grdMain,i, m,HWorkQtyCol);
|
// if (SYQuan <= 0)
|
// {
|
// break;
|
// }
|
// bDate = DBUtility.ClsPub.isDate(grdMain.get_TextMatrix(i, HPlanBeginDateCol)).ToString("yyyy-MM-dd");//µÃµ½¿ª¹¤ÈÕÆÚ
|
// CurDate = DBUtility.ClsPub.isDate(grdMain.get_TextMatrix(1, m)).ToString("yyyy-MM-dd");//µÃµ½ µÚÒ»ÐÐ ÈÕÆÚ
|
// SYHours = CountDayHours(grdMain,i, m,HMaterIDCol,HSourceIDCol,HYXCol,HReadyTimesCol,oCn);//µÃµ½ Ê£Óàʱ¼ä
|
// //µ±Ç°ÈÕÆÚСÓÚ¿ª¹¤ÈÕÆÚÇÒ¿ÉÌáǰÇÒÓÐÊ£Óàʱ¼ä
|
// if (SYHours > 0 && SYQuan > 0 && DBUtility.ClsPub.GridToColor(grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, m, i, m)) != DBUtility.ClsPub.Enum_Color.hx_Red)
|
// {
|
// if (DBUtility.ClsPub.GridToStr(grdMain.get_TextMatrix(i, HKTQCol)) != "0" || bDate.CompareTo(CurDate) < 0)
|
// {
|
// if (SYQuan < Convert.ToInt64(SYHours * HourQuan))
|
// {
|
// grdMain.set_TextMatrix(i, m, DBUtility.ClsPub.isDoule(SYQuan, 0));
|
// SYQuan = 0;
|
// if (i != iEndRow)
|
// {
|
// if (DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HYXCol)) != DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HYXCol))
|
// || DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HYXCol)) == 0)
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, m)) / HourQuan);
|
// grdMain.set_ColData(m, s);
|
// }
|
// }
|
// else
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - SYHours);
|
// grdMain.set_ColData(m, s);
|
// }
|
// }
|
// else
|
// {
|
// s = DBUtility.ClsPub.isDoule(SYHours * HourQuan, 0);
|
// grdMain.set_TextMatrix(i, m, s);
|
// SYQuan = SYQuan - DBUtility.ClsPub.isDoule((SYHours * HourQuan));
|
// if (i != iEndRow)
|
// {
|
// if (DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HYXCol)) != DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HYXCol))
|
// || DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HYXCol)) == 0)
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - SYHours);
|
// grdMain.set_ColData(m, s);
|
// }
|
// }
|
// else
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - SYHours);
|
// grdMain.set_ColData(m, s);
|
// }
|
// }
|
// }
|
// }
|
// else if (DBUtility.ClsPub.GridToColor(grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, m, i, m)) == DBUtility.ClsPub.Enum_Color.hx_Red)
|
// {
|
// SYQuan = SYQuan - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, m));
|
// }
|
// } // for m
|
// }
|
// }// for i
|
// //
|
// AddColor(grdMain, HPlanEndDateCol, FixCols);
|
// return true;
|
|
//}
|
|
|
////¹¤ÐòÅųÌ2
|
//public static bool CountDateSetupProc(AxVSFlex7.AxVSFlexGrid grdMain, int iBeginRow, int iEndRow, int FixCols, int HSourceIDCol, int HWorkQtyCol, int HSplitPlanQtyCol, int HSplitRelationQtyCol, int HPlanQtyCol, int HRelationQtyCol, int HICMoBillNoCol, int HPlanBeginDateCol, int HKTQCol, int HYXCol, int HPlanEndDateCol, int HMaterIDCol, int HReadyTimesCol, long HSourceID, SQLHelper.ClsCN oCn)
|
//{
|
// double HourQuan = 0, SYHours = 0;
|
// double SYQuan = 0;
|
// string bDate = "", CurDate = "";
|
// int i = 0, m;
|
// string s;
|
// int lJHSCol, lWGSCol;
|
// for (m = FixCols; m < grdMain.Cols; m++)
|
// {
|
// grdMain.set_ColData(m, GetWorkNumber(DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(1, m)), DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(iBeginRow, HSourceIDCol)), oCn));
|
// //ÉèÖà ×ÜÉϰàʱ¼ä£¬½«×ÜÉϰàʱ¼ä±£´æÓÚ COlData
|
// }
|
// for (i = iBeginRow; i <= iEndRow; i++)//¸ù¾ÝÊÖ¹¤Åų̣¬¿Û¼õ ºÄʱ
|
// {
|
// for (m = FixCols; m < grdMain.Cols; m++)
|
// {
|
// HourQuan = CountHourQuantity(grdMain, i, m, HWorkQtyCol);//µÃµ½ Сʱ ²úÄÜ
|
// //Èç¹ûºìÉ«×Ö²¢ÇÒÊýÁ¿²»Îª0ÔòΪ ÊÖ¹¤ÅųÌ
|
// if (DBUtility.ClsPub.GridToColor(grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, m, i, m)) == DBUtility.ClsPub.Enum_Color.hx_Red && DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, m)) != 0)
|
// {
|
// if (HourQuan != 0)//·ÀÖ¹ ³ýÊý Ϊ0
|
// {
|
// //¸ù¾ÝÊÖ¹¤Åų̼ÆËã ºÄʱ
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, m)) / HourQuan);
|
// grdMain.set_ColData(m, s);//½«Ê£Óàʱ¼ä±£´æÓÚCOLDATA
|
// }
|
// }
|
|
// }
|
// }
|
// //¸ù¾Ý ÉϵÀ¹¤Ðò £¬¿Û¼õºÄʱ
|
|
// //
|
// for (i = iBeginRow; i <= iEndRow; i++)
|
// {
|
// if (grdMain.get_RowHidden(i) == false)
|
// {
|
// if (IsCf(grdMain, HICMoBillNoCol, i))//¸ù¾ÝÊÇ·ñ²ð·Ö À´µÃµ½ ¶ÔÓ¦ÁÐ
|
// {
|
// lJHSCol = HSplitPlanQtyCol;
|
// lWGSCol = HSplitRelationQtyCol;
|
// }
|
// else
|
// {
|
// lJHSCol = HPlanQtyCol;
|
// lWGSCol = HRelationQtyCol;
|
// }
|
// SYQuan = DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, lJHSCol)) - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, lWGSCol));//µÃµ½ Ê£ÓàÊýÁ¿
|
// //
|
// for (m = FixCols; m < grdMain.Cols; m++)
|
// {
|
// HourQuan = CountHourQuantity(grdMain, i, m, HWorkQtyCol);
|
// if (SYQuan <= 0)
|
// {
|
// break;
|
// }
|
// bDate = DBUtility.ClsPub.isDate(grdMain.get_TextMatrix(i, HPlanBeginDateCol)).ToString("yyyy-MM-dd");//µÃµ½¿ª¹¤ÈÕÆÚ
|
// CurDate = DBUtility.ClsPub.isDate(grdMain.get_TextMatrix(1, m)).ToString("yyyy-MM-dd");//µÃµ½ µÚÒ»ÐÐ ÈÕÆÚ
|
// SYHours = CountDayHours(grdMain, i, m, HMaterIDCol, HSourceIDCol, HYXCol, HReadyTimesCol, oCn);//µÃµ½ Ê£Óàʱ¼ä
|
// //µ±Ç°ÈÕÆÚСÓÚ¿ª¹¤ÈÕÆÚÇÒ¿ÉÌáǰÇÒÓÐÊ£Óàʱ¼ä
|
// if (SYHours > 0 && SYQuan > 0 && DBUtility.ClsPub.GridToColor(grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, m, i, m)) != DBUtility.ClsPub.Enum_Color.hx_Red)
|
// {
|
// if (DBUtility.ClsPub.GridToStr(grdMain.get_TextMatrix(i, HKTQCol)) != "0" || bDate.CompareTo(CurDate) < 0)
|
// {
|
// if (SYQuan < Convert.ToInt64(SYHours * HourQuan))
|
// {
|
// grdMain.set_TextMatrix(i, m, DBUtility.ClsPub.isDoule(SYQuan, 0));
|
// SYQuan = 0;
|
// if (i != iEndRow)
|
// {
|
// if (DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HYXCol)) != DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HYXCol))
|
// || DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HYXCol)) == 0)
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, m)) / HourQuan);
|
// grdMain.set_ColData(m, s);
|
// }
|
// }
|
// else
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - SYHours);
|
// grdMain.set_ColData(m, s);
|
// }
|
// }
|
// else
|
// {
|
// s = DBUtility.ClsPub.isDoule(SYHours * HourQuan, 0);
|
// grdMain.set_TextMatrix(i, m, s);
|
// SYQuan = SYQuan - DBUtility.ClsPub.isDoule((SYHours * HourQuan));
|
// if (i != iEndRow)
|
// {
|
// if (DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HYXCol)) != DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HYXCol))
|
// || DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HYXCol)) == 0)
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - SYHours);
|
// grdMain.set_ColData(m, s);
|
// }
|
// }
|
// else
|
// {
|
// s = Convert.ToString(DBUtility.ClsPub.isDoule(grdMain.get_ColData(m)) - SYHours);
|
// grdMain.set_ColData(m, s);
|
// }
|
// }
|
// }
|
// }
|
// else if (DBUtility.ClsPub.GridToColor(grdMain.get_Cell(VSFlex7.CellPropertySettings.flexcpForeColor, i, m, i, m)) == DBUtility.ClsPub.Enum_Color.hx_Red)
|
// {
|
// SYQuan = SYQuan - DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, m));
|
// }
|
// } // for m
|
// }
|
// }// for i
|
// //
|
// AddColor(grdMain, HPlanEndDateCol, FixCols);
|
// return true;
|
|
//}
|
|
////µÃµ½Ð¡Ê±²úÄÜ
|
//public static double CountHourQuantity(AxVSFlex7.AxVSFlexGrid grdMain, int iRow, int iCol, int HWorkQtyCol)
|
//{
|
// return DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(iRow, HWorkQtyCol));
|
//}
|
|
////ÅųÌ
|
//public static void DateSetup(AxVSFlex7.AxVSFlexGrid grdMain, bool bAuto,ref int m, ref bool b, ref long lSourceID, ref int e, ref bool bEdit, int FixCols, int HSourceIDCol, int HWorkQtyCol, int HSplitPlanQtyCol, int HSplitRelationQtyCol, int HPlanQtyCol, int HRelationQtyCol, int HICMoBillNoCol, int HPlanBeginDateCol, int HKTQCol, int HYXCol, int HPlanEndDateCol, int HMaterIDCol, int HReadyTimesCol,SQLHelper.ClsCN oCn)
|
//{
|
// b = true;
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// if (b == true)//³õʼ»¯
|
// {
|
// lSourceID = DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HSourceIDCol));
|
// m = i;
|
// e = 0;
|
// b = false;
|
// }
|
// //
|
// if (i + 1 >= grdMain.Rows)//×îºóÒ»ÐÐ
|
// {
|
// CountDateSetup(grdMain, m, i, FixCols, HSourceIDCol, HWorkQtyCol, HSplitPlanQtyCol, HSplitRelationQtyCol, HPlanQtyCol, HRelationQtyCol, HICMoBillNoCol, HPlanBeginDateCol, HKTQCol, HYXCol, HPlanEndDateCol, HMaterIDCol, HReadyTimesCol, lSourceID, oCn);
|
|
// }
|
// else
|
// {
|
// if (lSourceID != DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HSourceIDCol)))
|
// {
|
// CountDateSetup(grdMain, m, m + e, FixCols, HSourceIDCol, HWorkQtyCol, HSplitPlanQtyCol, HSplitRelationQtyCol, HPlanQtyCol, HRelationQtyCol, HICMoBillNoCol, HPlanBeginDateCol, HKTQCol, HYXCol, HPlanEndDateCol, HMaterIDCol, HReadyTimesCol, lSourceID, oCn);
|
// b = true;
|
// }
|
// }
|
// e++;
|
// }
|
// bEdit = false;
|
//}
|
|
////¹¤ÐòÅųÌ
|
//public static void DateSetupProc(AxVSFlex7.AxVSFlexGrid grdMain, bool bAuto, ref int m, ref bool b, ref long lSourceID, ref int e, ref bool bEdit, int FixCols, int HSourceIDCol, int HWorkQtyCol, int HSplitPlanQtyCol, int HSplitRelationQtyCol, int HPlanQtyCol, int HRelationQtyCol, int HICMoBillNoCol, int HPlanBeginDateCol, int HKTQCol, int HYXCol, int HPlanEndDateCol, int HMaterIDCol, int HReadyTimesCol, SQLHelper.ClsCN oCn)
|
//{
|
// b = true;
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++) //´ÓµÚÒ»ÐÐ µ½×îºóÒ»ÐÐ
|
// {
|
// if (b == true)//³õʼ»¯
|
// {
|
// lSourceID = DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HSourceIDCol)); //µÃµ½×ÊÔ´ID
|
// m = i;
|
// e = 0;
|
// b = false;
|
// }
|
// //
|
// if (i + 1 >= grdMain.Rows)//×îºóÒ»ÐÐ
|
// {
|
// CountDateSetupProc(grdMain, m, i, FixCols, HSourceIDCol, HWorkQtyCol, HSplitPlanQtyCol, HSplitRelationQtyCol, HPlanQtyCol, HRelationQtyCol, HICMoBillNoCol, HPlanBeginDateCol, HKTQCol, HYXCol, HPlanEndDateCol, HMaterIDCol, HReadyTimesCol, lSourceID, oCn);
|
|
// }
|
// else
|
// {
|
// if (lSourceID != DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i + 1, HSourceIDCol))) //µ±×ÊÔ´ ±ä»¯Ê±
|
// {
|
// CountDateSetupProc(grdMain, m, m + e, FixCols, HSourceIDCol, HWorkQtyCol, HSplitPlanQtyCol, HSplitRelationQtyCol, HPlanQtyCol, HRelationQtyCol, HICMoBillNoCol, HPlanBeginDateCol, HKTQCol, HYXCol, HPlanEndDateCol, HMaterIDCol, HReadyTimesCol, lSourceID, oCn);
|
// b = true;
|
// }
|
// }
|
// e++;
|
// }
|
// bEdit = false;
|
//}
|
|
|
//²é¿´¿ÉÅųÌ×ÊÔ´
|
public static void GetSourceByMater(SQLHelper.ClsCN oCn, DataGridView grd, Int64 sMaterID)
|
{
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("select ĬÈϱê¼Ç=case HStandard when 1 then 'Y' else '' end,Éú²ú×ÊÔ´´úÂë=Hnumber,Éú²ú×ÊÔ´=Hname,ÀàÐÍ=HType,[²úÄÜ(Сʱ)]=HWorkQty,±¸×¢=HRemark " +
|
"from h_v_Sc_GetSource2 where Hmaterid=" + sMaterID.ToString(), "h_v_Sc_GetSource2");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
grd.DataSource = null;
|
}
|
else
|
{
|
grd.DataSource = oDs.Tables[0].DefaultView;
|
}
|
//
|
}
|
|
//²é¿´ÈÎÎñµ¥ÐÅÏ¢
|
public static void GetICMOInfoByID(SQLHelper.ClsCN oCn, DataGridView grd, Int64 sHInterID)
|
{
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("select ״̬,¹¤×÷ÖÐÐÄ,ÏúÊÛ¶©µ¥ºÅ,ÒµÎñÔ±,ÈÎÎñµ¥ºÅ,Éú²ú³µ¼ä,²úÆ·´úÂë,²úÆ·Ãû³Æ " +
|
" ,¹æ¸ñÐͺÅ,¼ÆÁ¿µ¥Î»,ÈÎÎñµ¥ÊýÁ¿,¼Æ»®¿ª¹¤,¼Æ»®Í깤,×î³Ù¿ª¹¤ÈÕÆÚ,×î³ÙÍ깤ÈÕÆÚ from h_v_Sc_ICMOBillInfo Where HinterID=" + sHInterID.ToString(), "h_v_Sc_ICMOBillInfo");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
grd.DataSource = null;
|
}
|
else
|
{
|
grd.DataSource = oDs.Tables[0].DefaultView;
|
}
|
//
|
}
|
|
////¸ù¾ÝÈÎÎñµ¥ºÍÎïÁÏ£¬·µ»Ø¿ÉÉú²ú×ÊÔ´
|
/// <summary>
|
/// ¸ù¾ÝÈÎÎñµ¥ºÍÎïÁÏ£¬·µ»Ø¿ÉÉú²ú×ÊÔ´ Ê£Ó๤ʱ
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID"></param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static DataSet GetWorkSourceByICMO(SQLHelper.ClsCN oCn,Int64 lMainID,DateTime EndDate,Single SProdTimes)
|
{
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("exec h_p_Sc_ICMOGetWorkSource " + lMainID.ToString() + ",'" + EndDate.ToShortDateString() + "'," + SProdTimes.ToString(), "h_p_Sc_ICMOGetWorkSource");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return null;
|
}
|
else
|
{
|
return oDs;
|
}
|
//
|
}
|
|
|
////¸ù¾Ý¹¤Ðòµ¥ºÍÎïÁÏ£¬·µ»Ø¿ÉÉú²ú×ÊÔ´
|
/// <summary>
|
/// ¸ù¾Ý¹¤Ðòµ¥ºÍÎïÁÏ£¬·µ»Ø¿ÉÉú²ú×ÊÔ´ Ê£Ó๤ʱ ÕÒµ½¹¤ÐòÉϵÀ½áÊøÊ±¼ä ¼° ±¾µÀÔÊÐí¿ªÊ¼Ê±¼ä
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID"></param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static DataSet GetWorkSourceByProc(SQLHelper.ClsCN oCn, Int64 lMainID, DateTime EndDate, Single SProdTimes,Int64 lProcPlanInterID,Int64 lProcPlanEntryID)
|
{
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("exec h_p_Sc_ProcGetWorkSource " + lMainID.ToString() + ",'" + EndDate.ToShortDateString() + "'," + SProdTimes.ToString() + "," + lProcPlanInterID.ToString() + "," + lProcPlanEntryID.ToString() , "h_p_Sc_ProcGetWorkSource");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return null;
|
}
|
else
|
{
|
return oDs;
|
}
|
//
|
}
|
|
|
////ÕÒµ½Éú²ú×ÊÔ´
|
/// <summary>
|
/// ¸ù¾ÝͬԤ¼Æ¿ª¹¤ÈÕÆÚÖРͬ²úÆ·£¬Í¬ÁÏÓÅÏÈ£¬Æä´Î×î¿ÕÏÐ×ÊÔ´
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID">²úÆ·ÄÚÂë</param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static Int64 GetWorkSourceByInfo(SQLHelper.ClsCN oCn, Int64 lMainID,DateTime EndDate,Int64 lProcPlanInterID, Int64 lProcPlanEntryID,ref string sSourceName,ref string sSourceNumber)
|
{
|
DataSet oDs;
|
//ÔÚ2ÌìÄڼƻ® ÖÐÕÒµ½ ͬ²úƷͬ¹¤Ðò ×ÊÔ´
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetWorkSourceBySameProd " + lMainID.ToString() + ",'" + EndDate.ToShortDateString() + "'," + lProcPlanInterID.ToString() + "," + lProcPlanEntryID.ToString(), "h_p_Sc_GetWorkSourceByFree");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
//
|
}
|
else
|
{
|
sSourceName = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["×ÊÔ´Ãû³Æ"]));
|
sSourceNumber = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["×ÊÔ´´úÂë"]));
|
return DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0]["HItemID"]);
|
}
|
//ÔÚ2ÌìÄڼƻ® ÖÐÕÒµ½ ͬÁÏ×ÊÔ´
|
|
|
|
//ÕÒµ½×î¿ÕÏÐÉú²ú×ÊÔ´
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetWorkSourceByFree " + lMainID.ToString() + ",'" + EndDate.ToShortDateString() + "'," + lProcPlanInterID.ToString() + "," + lProcPlanEntryID.ToString(), "h_p_Sc_GetWorkSourceByFree");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return 0;
|
}
|
else
|
{
|
sSourceName = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["×ÊÔ´Ãû³Æ"]));
|
sSourceNumber = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["×ÊÔ´´úÂë"]));
|
return DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0]["HItemID"]);
|
}
|
//
|
}
|
|
|
////ÕÒµ½Ö¸¶¨Éú²ú×ÊÔ´
|
/// <summary>
|
/// ¸ù¾Ý¹¤ÒÕ·Ï߯ôÓ㬠ÕÒµ½ Ö¸¶¨µÄ ²úÏß¡£
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID">²úÆ·ÄÚÂë</param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static Int64 GetFixWorkSourceByInfo(SQLHelper.ClsCN oCn, Int64 lMainID, DateTime EndDate, Int64 lProcPlanInterID, Int64 lProcPlanEntryID, ref string sSourceName, ref string sSourceNumber)
|
{
|
DataSet oDs;
|
//ÕÒµ½Ö¸¶¨Éú²ú×ÊÔ´
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetWorkSourceByFix " + lProcPlanInterID.ToString() + "," +lProcPlanEntryID.ToString() + "," + lMainID.ToString(), "h_p_Sc_GetWorkSourceByFix");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return 0;
|
}
|
else
|
{
|
sSourceName = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["×ÊÔ´Ãû³Æ"]));
|
sSourceNumber = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["×ÊÔ´´úÂë"]));
|
return DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0]["HItemID"]);
|
}
|
//
|
}
|
|
|
////ÕÒµ½Ö¸¶¨²úÏß LineCenter
|
/// <summary>
|
/// ¸ù¾Ý¹¤ÒÕ·Ï߯ôÓ㬠ÕÒµ½ Ö¸¶¨µÄ ²úÏß¡£
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID">²úÆ·ÄÚÂë</param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static Int64 GetFixWorkLineSourceByInfo(SQLHelper.ClsCN oCn, Int64 lMainID, DateTime EndDate, Int64 lProcPlanInterID, Int64 lProcPlanEntryID, ref string sSourceName, ref string sSourceNumber)
|
{
|
DataSet oDs;
|
//ÕÒµ½Ö¸¶¨Éú²ú×ÊÔ´
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetWorkLineSourceByFix " + lProcPlanInterID.ToString() + "," + lProcPlanEntryID.ToString() + "," + lMainID.ToString(), "h_p_Sc_GetWorkSourceByFix");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return 0;
|
}
|
else
|
{
|
sSourceName = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["×ÊÔ´Ãû³Æ"]));
|
sSourceNumber = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["×ÊÔ´´úÂë"]));
|
return DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0]["HItemID"]);
|
}
|
//
|
}
|
|
|
/// <summary>
|
/// ¸ù¾ÝÈÎÎñµ¥ºÍÎïÁÏ£¬·µ»Ø¿ÉÉú²ú×ÊÔ´ Ê£Ó๤ʱ
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID"></param>
|
/// <param name="EndDate"></param>
|
/// <param name="lSourceID"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static DataSet GetWorkSourceByICMO(SQLHelper.ClsCN oCn, Int64 lMainID, DateTime EndDate,Int64 lSourceID, Single SProdTimes)
|
{
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("exec h_p_Sc_ICMOGetWorkSource2 " + lMainID.ToString() + ",'" + EndDate.ToShortDateString() + "'," + SProdTimes.ToString() + "," +lSourceID.ToString(), "h_p_Sc_ICMOGetWorkSource");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return null;
|
}
|
else
|
{
|
return oDs;
|
}
|
//
|
}
|
|
////¸ù¾ÝÉú²ú×ÊÔ´£¬·µ»ØÊ£Ó๤ʱ
|
/// <summary>
|
/// ¸ù¾ÝÉú²ú×ÊÔ´£¬·µ»ØÊ£Ó๤ʱ
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID"></param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static DataSet GetWorkSourceTimeBySource(SQLHelper.ClsCN oCn, Int64 lSourceID)
|
{
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("exec h_p_Sc_ICMOGetWorkSourceTime " + lSourceID.ToString(), "h_p_Sc_ICMOGetWorkSourceTime");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return null;
|
}
|
else
|
{
|
return oDs;
|
}
|
//
|
}
|
|
|
//¸ù¾Ý¿ª¹¤ÊýÁ¿·µ»ØÕ¼ÓÃÌìÊý
|
/// <summary>
|
/// ¸ù¾Ý¿ª¹¤ÊýÁ¿·µ»ØÕ¼ÓÃÌìÊý
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lSourceID"></param>
|
/// <param name="lProcPlanInterID"></param>
|
/// <param name="lProcPlanEntryID"></param>
|
/// <returns></returns>
|
public static DataSet GetUseSourceTimeByBeginQty(SQLHelper.ClsCN oCn,Int64 lProcPlanInterID, Int64 lProcPlanEntryID)
|
{
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetUseSourceTimeByBeginQty " + lProcPlanInterID.ToString() + "," + lProcPlanEntryID.ToString(), "h_p_Sc_GetUseSourceTimeByBeginQty");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return null;
|
}
|
else
|
{
|
return oDs;
|
}
|
}
|
|
|
public static void GetMouldNumber(ref string sMouldPreNumber, ref string sMouldNumber,ref double sChangeTimes,Int64 HMaterID,Int64 HSourceID)
|
{
|
DataSet oDs;
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
//
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetMouldNumber " + HMaterID.ToString() + "," + HSourceID.ToString() , "h_p_Sc_GetMouldNumber");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
sMouldPreNumber = "";
|
sMouldNumber = "";
|
sChangeTimes = 0;
|
return;
|
}
|
else
|
{
|
sMouldPreNumber = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HPreMouldNumber"]);
|
sMouldNumber = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HMouldNumber"]);
|
sChangeTimes = DBUtility.ClsPub.isDoule(oDs.Tables[0].Rows[0]["HChangeTimes"]);
|
return;
|
}
|
//
|
}
|
|
|
////¸ù¾ÝÉú²ú×ÊÔ´+ÈÕÆÚ£¬·µ»ØÊ£Ó๤ʱ ¹¤Ðò
|
/// <summary>
|
/// ¸ù¾ÝÉú²ú×ÊÔ´+ÈÕÆÚ£¬·µ»ØÊ£Ó๤ʱ ¹¤Ðò
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID"></param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static DataSet GetWorkSourceTimeBySource_Proc(SQLHelper.ClsCN oCn, Int64 lSourceID, Int64 lProcPlanInterID, Int64 lProcPlanEntryID)
|
{
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("exec h_p_Sc_ICMOGetWorkSourceTime_Proc " + lSourceID.ToString() +","+ lProcPlanInterID.ToString() + "," +lProcPlanEntryID.ToString(), "h_p_Sc_ICMOGetWorkSourceTime_Proc");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return null;
|
}
|
else
|
{
|
return oDs;
|
}
|
//
|
}
|
|
////¸ù¾ÝÉú²ú×ÊÔ´ ÕÒµ½ ¿ª¹¤Ê±¼ä£¨Ê×µÀ¹¤Ðò¿¼ÂÇ ÉϸöÈÎÎñµ¥ ÅÅ³ÌµÄ ÏÂÒ»Ìì¡£ ÆäËû¿¼ÂÇ ¿ª¹¤ÓàÁ¿£¬Èç¹ûÉϵÀ¹¤Ðò»òÕßÉϸöÈÎÎñµ¥ ÒѾÔÚ¼Ó
|
//°àʱ¼äÄÚ£¬ÔòÏÂÒ»Ì죩
|
//¿ªÊ¼Ê±¼ä=ÉϵÀ½áÊøÊ±¼ä+±¾×ÊÔ´¿ÕÏпªÊ¼£©
|
/// <summary>
|
/// ¸ù¾ÝÉú²ú×ÊÔ´+ÈÕÆÚ£¬·µ»ØÊ£Ó๤ʱ ¹¤Ðò
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID"></param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static DateTime Sc_GetBeginWorkTimeBySource_Proc(SQLHelper.ClsCN oCn, Int64 lSourceID, Int64 lProcPlanInterID, Int64 lProcPlanEntryID)
|
{
|
//µÃµ½ ×ÊÔ´¿ÕÏпªÊ¼Ê±¼ä
|
DateTime dSourceFreeBTime;
|
DataSet oDs;
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetSourceFreeBTime " + lSourceID.ToString() , "h_p_Sc_GetSourceFreeBTime");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return Convert.ToDateTime("1900-01-01");
|
}
|
else
|
{
|
dSourceFreeBTime = DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[0][0]);
|
}
|
//µÃµ½ Éϼ¶ÈÎÎñµ¥ Í깤ʱ¼ä
|
DateTime preICMOEndTime;
|
oDs = oCn.RunProcReturn("exec h_p_K3_Sc_GetPreICMOEndTime " + lProcPlanInterID.ToString() + "," + lProcPlanEntryID.ToString(), "h_p_Sc_GetSourceFreeBTime");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
//
|
preICMOEndTime = Convert.ToDateTime("2000-01-01");
|
}
|
else
|
{
|
preICMOEndTime = DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[0][0]);
|
}
|
//µÃµ½ ÉϵÀ¹¤Ðò ÒÆ½» ʱ¼ä
|
DateTime preProcEndTime;
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetPreProcEndTime " + lSourceID.ToString() + "," + lProcPlanInterID.ToString() + "," + lProcPlanEntryID.ToString(), "h_p_Sc_GetPreProcEndTime");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
preProcEndTime = dSourceFreeBTime;
|
return dSourceFreeBTime;
|
}
|
else
|
{
|
preProcEndTime = DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[0][0]);
|
}
|
if (preProcEndTime > dSourceFreeBTime)
|
{
|
if (preICMOEndTime > preProcEndTime)
|
{
|
return preICMOEndTime;
|
}
|
else
|
{
|
return preProcEndTime;
|
}
|
}
|
else
|
{
|
if (preICMOEndTime > dSourceFreeBTime)
|
{
|
return preICMOEndTime;
|
}
|
else
|
{
|
return dSourceFreeBTime;
|
}
|
}
|
}
|
|
////¸ù¾ÝÉú²ú×ÊÔ´ ÕÒµ½ ¿ª¹¤Ê±¼ä£¨Ê×µÀ¹¤Ðò¿¼ÂÇ ÉϸöÈÎÎñµ¥ ÅÅ³ÌµÄ ÏÂÒ»Ìì¡£ ÆäËû¿¼ÂÇ ¿ª¹¤ÓàÁ¿£¬Èç¹ûÉϵÀ¹¤Ðò ÒѾÔÚ¼Ó
|
//°àʱ¼äÄÚ£¬ÔòÏÂÒ»Ì죩
|
//¿ªÊ¼Ê±¼ä
|
/// <summary>
|
/// ¸ù¾ÝÉú²ú×ÊÔ´+ÈÕÆÚ£¬·µ»ØÊ£Ó๤ʱ ¹¤Ðò
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID"></param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static DateTime Sc_GetBeginWorkTimeByLineSource_Proc(SQLHelper.ClsCN oCn, Int64 lSourceID, Int64 lProcPlanInterID, Int64 lProcPlanEntryID)
|
{
|
//µÃµ½ ×ÊÔ´¿ÕÏпªÊ¼Ê±¼ä
|
DateTime dSourceFreeBTime;
|
DataSet oDs;
|
if (lProcPlanInterID == 6357)
|
{
|
lProcPlanInterID = lProcPlanInterID;
|
}
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetLineSourceFreeBTime " + lSourceID.ToString(), "h_p_Sc_GetSourceFreeBTime");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return Convert.ToDateTime("1900-01-01");
|
}
|
else
|
{
|
dSourceFreeBTime = DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[0][0]);
|
}
|
//µÃµ½ ÉϵÀ¹¤Ðò ÒÆ½» ʱ¼ä
|
if (lProcPlanInterID == 6355)
|
{
|
lProcPlanInterID = lProcPlanInterID;
|
}
|
DateTime preProcEndTime;
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetLinePreProcEndTime " + lSourceID.ToString() + "," + lProcPlanInterID.ToString() + "," + lProcPlanEntryID.ToString(), "h_p_Sc_GetPreProcEndTime");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
preProcEndTime = dSourceFreeBTime;
|
return dSourceFreeBTime;
|
}
|
else
|
{
|
preProcEndTime = DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[0][0]);
|
}
|
if (preProcEndTime > dSourceFreeBTime)
|
{
|
return preProcEndTime;
|
}
|
else
|
{
|
return dSourceFreeBTime;
|
}
|
}
|
|
|
//¸ù¾Ý¿â´æ»ñÈ¡¿ªÊ¼ÈÕÆÚ
|
/// <summary>
|
/// ¸ù¾Ý¿â´æ¼°ÔÚ;Êý£¬ ¼ÆË㿪ʼÈÕÆÚ
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID"></param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static DateTime Sc_GetBeginWorkTimeByMater(SQLHelper.ClsCN oCn, Int64 lMaterID, Int64 lProcPlanInterID, Int64 lProcPlanEntryID)
|
{
|
//Èç¹û¿â´æ³ä×ã Ôò¿ªÊ¼ÈÕÆÚΪ ½ñÌì,Èç¹û¿â´æ²»×㣬Ôò ¼ÆËã ÔÚ;»òÔÚÖÆÊýÁ¿£¬Èç¹û×ã¹» Ôò»ñÈ¡ ²É¹º¶©µ¥ Åų̵¥ Èë¿âÈÕÆÚ£¬²¢°´ Èյݼõ
|
DateTime dSourceFreeBTime;
|
DataSet oDs;
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetSourceFreeBTimeByMater " + lMaterID.ToString() + "," + lProcPlanInterID.ToString() + "," + lProcPlanEntryID.ToString(), "h_p_Sc_GetSourceFreeBTimeByMater");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return Convert.ToDateTime("2020-01-01");
|
}
|
else
|
{
|
dSourceFreeBTime = DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[0][0]);
|
}
|
//
|
return dSourceFreeBTime;
|
}
|
|
|
///¸ù¾ÝÎïÁÏ£¬·µ»Ø¹¤ÒÕÁ÷
|
/// <summary>
|
/// ¸ù¾ÝÎïÁÏ£¬·µ»Ø¹¤ÒÕÁ÷
|
/// </summary>
|
/// <param name="oCn"></param>
|
/// <param name="lMainID"></param>
|
/// <param name="EndDate"></param>
|
/// <param name="SProdTimes"></param>
|
/// <returns></returns>
|
public static void GetProcFlowInfoByMaterID(SQLHelper.ClsCN oCn,DataGridView grdProcFlow, Int64 lMaterID)
|
{
|
DataSet oDs;
|
//
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetProcFlowInfoByMater " + lMaterID.ToString(), "h_p_Sc_GetProcFlowInfoByMater");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
grdProcFlow.DataSource = null;
|
}
|
else
|
{
|
grdProcFlow.DataSource = oDs.Tables[0].DefaultView;
|
}
|
//
|
}
|
|
////¸ù¾ÝÎïÁÏ ×ÊÔ´ ¼ÆË㹤ʱ
|
//public static void GetWorkTimeByID(SQLHelper.ClsCN oCn, Label slblWorkTime, AxVSFlex7.AxVSFlexGrid grdMain, int HMaterIDCol, int HSorceIDCol, int FixCols)
|
//{
|
// DataSet oDs;
|
// long HMaterID = 0;
|
// long HSourceID = 0;
|
// double HQty = 0;
|
// double HWorkQty = 0;
|
// double HWorkTime = 0;
|
// int Row = -1;
|
// int Rows = -1;
|
// int Col = -1;
|
// int Cols = -1;
|
// //
|
// if (grdMain.Row > grdMain.RowSel)
|
// {
|
// Row = grdMain.RowSel;
|
// Rows = grdMain.Row;
|
// }
|
// else
|
// {
|
// Row = grdMain.Row;
|
// Rows = grdMain.RowSel;
|
// }
|
// if (grdMain.Col > grdMain.ColSel)
|
// {
|
// Col = grdMain.ColSel;
|
// Cols = grdMain.Col;
|
// }
|
// else
|
// {
|
// Col = grdMain.Col;
|
// Cols = grdMain.ColSel;
|
// }
|
// //
|
// for (int i = Row; i <= Rows; i++)
|
// {
|
// HMaterID = DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HMaterIDCol));
|
// HSourceID = DBUtility.ClsPub.isLong(grdMain.get_TextMatrix(i, HSorceIDCol));
|
// for (int j = Col; j <= Cols; j++)
|
// {
|
// if (j >= FixCols)
|
// {
|
// HQty = DBUtility.ClsPub.isDoule(grdMain.get_TextMatrix(i, j));
|
// oDs = oCn.RunProcReturn("exec h_p_Gy_GetWorkTime " + HMaterID.ToString() + "," + HSourceID.ToString(), "h_p_Gy_GetWorkTime");
|
// if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
// {
|
// HWorkTime = HWorkTime;
|
// }
|
// else
|
// {
|
// HWorkQty = DBUtility.ClsPub.isDoule(oDs.Tables[0].Rows[0][0]);
|
// if (HWorkQty != 0)
|
// {
|
// HWorkTime = HWorkTime + (HQty / HWorkQty);
|
// }
|
// else
|
// {
|
// HWorkTime = HWorkTime;
|
// }
|
// }
|
// }
|
// }
|
// }
|
// //
|
// slblWorkTime.Text = DBUtility.ClsPub.isDoule(HWorkTime, 2).ToString();
|
//}
|
|
|
/// <summary>
|
/// ½«Êý¾ÝдÈëÍø¸ñ
|
/// </summary>
|
/// <param name="grd"></param>
|
/// <param name="iRow"></param>
|
/// <param name="sLeftQty"></param>
|
/// <param name="sWorkQty"></param>
|
public static void SetMonthInfoToGrid(DataGridView grd, int iRow,ref Single sLeftQty, Single sWorkQty, int FixCols)
|
{
|
for (int i = FixCols; i < grd.ColumnCount; i++)
|
{
|
if (sLeftQty > 0)
|
{
|
if (DBUtility.ClsPub.isSingle(grd.Columns[i].Tag) > 0)
|
{
|
if (DBUtility.ClsPub.isSingle(grd.Columns[i].Tag) > sLeftQty)
|
{
|
grd.Columns[i].Tag = DBUtility.ClsPub.isSingle(grd.Columns[i].Tag) - sLeftQty;
|
grd.Rows[iRow].Cells[i].Value = sLeftQty.ToString();
|
sLeftQty = 0;
|
break;
|
}
|
else
|
{
|
|
sLeftQty = sLeftQty - DBUtility.ClsPub.isSingle(grd.Columns[i].Tag);
|
grd.Rows[iRow].Cells[i].Value = DBUtility.ClsPub.isSingle(grd.Columns[i].Tag);
|
grd.Columns[i].Tag = "0";
|
}
|
}
|
}
|
else
|
{
|
break;
|
}
|
}
|
}
|
|
|
//½«Êý¾ÝÅų̵½Íø¸ñ
|
/// <summary>
|
/// ½«Êý¾ÝÅų̵½Íø¸ñ
|
/// </summary>
|
/// <param name="grd"></param>
|
/// <param name="ds"></param>
|
/// <param name="dsPre"></param>
|
/// <param name="iRow"></param>
|
/// <param name="sLeftQty"></param>
|
/// <param name="sWorkQty"></param>
|
/// <param name="bAddFlag">¼Ó°à±ê¼Ç</param>
|
public static void SetInfoToGrid(DataGridView grd, DataSet ds, DataSet dsPre, int iRow, ref Single sLeftQty, Single sWorkQty, bool bAddFlag, List<ClsGridValues> oClsGridValues)
|
{
|
bool b = false;
|
ClsGridValues oSub;
|
//Ñ»·Íø¸ñÁÐ
|
if (bAddFlag)
|
{
|
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
{
|
//ÕÒµ½¶ÔÓ¦µÄÁÐ
|
for (int j = 8; j < grd.ColumnCount; j++)
|
{
|
if (sLeftQty > 0)
|
{
|
if (DBUtility.ClsPub.isDate(ds.Tables[0].Rows[i]["ÈÕÆÚ"]) == DBUtility.ClsPub.isDate(grd.Columns[j].Tag)) //±í¸ñµÄ±êÌâÉÏ ±£´æÁËÈÕÆÚ£»
|
{
|
//Èç¹ûʱ¼ä±» ÉϵÀÓàÁ¿Õ¼Óà Ôò Ìø¹ý
|
b = false;
|
if (dsPre != null && dsPre.Tables[0].Rows.Count > 0)
|
{
|
for (int m = 0; m < dsPre.Tables[0].Rows.Count; m++)
|
{
|
if (DBUtility.ClsPub.isDate(ds.Tables[0].Rows[i]["ÈÕÆÚ"]) < DBUtility.ClsPub.isDate(dsPre.Tables[0].Rows[m]["ÈÕÆÚ"]))
|
{
|
b = true;
|
}
|
}
|
}
|
if (b==false)
|
{
|
if (dsPre != null && DBUtility.ClsPub.isDate(ds.Tables[0].Rows[i]["ÈÕÆÚ"]) == DBUtility.ClsPub.isDate(dsPre.Tables[0].Rows[0]["ÈÕÆÚ"]))
|
{
|
//HUseTimes Ϊ ÉϵÀÓàÁ¿ºó Ê£Ó๤ʱ¡£
|
if (DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"]) > ( DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"])))
|
{
|
if (sLeftQty > DBUtility.ClsPub.isLong(sWorkQty * ( DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]))))
|
{
|
grd.Rows[iRow].Cells[j].Value = DBUtility.ClsPub.isLong(sWorkQty * ( DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"])));
|
sLeftQty = sLeftQty - DBUtility.ClsPub.isLong(sWorkQty * ( DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"])));
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]);
|
oClsGridValues.Add(oSub);
|
}
|
else
|
{
|
grd.Rows[iRow].Cells[j].Value = sLeftQty;
|
sLeftQty = 0;
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]);
|
oClsGridValues.Add(oSub);
|
}
|
}
|
else //׿Á¦²»ÐèÒª¿¼ÂǼӰ࣬ÏÂÃæµÄÕâÒ»¶Î²»ÐèÒª
|
{
|
if (sLeftQty > sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"]))
|
{
|
grd.Rows[iRow].Cells[j].Value = DBUtility.ClsPub.isLong(sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"]));
|
sLeftQty = sLeftQty - (DBUtility.ClsPub.isLong(sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"])));
|
sLeftQty = 0;
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"]);
|
oClsGridValues.Add(oSub);
|
}
|
else
|
{
|
grd.Rows[iRow].Cells[j].Value = sLeftQty;
|
sLeftQty = 0;
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"]);
|
oClsGridValues.Add(oSub);
|
}
|
}
|
}
|
else
|
{
|
if (sLeftQty > sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"]))
|
{
|
grd.Rows[iRow].Cells[j].Value = DBUtility.ClsPub.isLong(sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"]));
|
sLeftQty = sLeftQty - (DBUtility.ClsPub.isLong(sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"])));
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"]);
|
oClsGridValues.Add(oSub);
|
}
|
else
|
{
|
grd.Rows[iRow].Cells[j].Value = sLeftQty;
|
sLeftQty = 0;
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["×î´óÊ£Ó๤ʱ"]);
|
oClsGridValues.Add(oSub);
|
|
}
|
}
|
}
|
}
|
}
|
}
|
|
}
|
|
}
|
else
|
{
|
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
{
|
//ÕÒµ½¶ÔÓ¦µÄÁÐ
|
for (int j = 8; j < grd.ColumnCount; j++)
|
{
|
if (sLeftQty > 0)
|
{
|
if (DBUtility.ClsPub.isDate(ds.Tables[0].Rows[i]["ÈÕÆÚ"]) == DBUtility.ClsPub.isDate(grd.Columns[j].HeaderText))
|
{
|
//Èç¹ûʱ¼ä±» ÉϵÀÓàÁ¿Õ¼Óà Ôò Ìø¹ý
|
b = false;
|
if (dsPre != null && dsPre.Tables[0].Rows.Count > 0)
|
{
|
for (int m = 0; m < dsPre.Tables[0].Rows.Count; m++)
|
{
|
if (DBUtility.ClsPub.isDate(ds.Tables[0].Rows[i]["ÈÕÆÚ"]) < DBUtility.ClsPub.isDate(dsPre.Tables[0].Rows[m]["ÈÕÆÚ"]))
|
{
|
b = true;
|
}
|
}
|
}
|
if (b == false)
|
{
|
if (dsPre != null && DBUtility.ClsPub.isDate(ds.Tables[0].Rows[i]["ÈÕÆÚ"]) == DBUtility.ClsPub.isDate(dsPre.Tables[0].Rows[0]["ÈÕÆÚ"]))
|
{
|
if (DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"]) > ( DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"])))
|
{
|
if (sLeftQty > DBUtility.ClsPub.isLong(sWorkQty * ( DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]))))
|
{
|
grd.Rows[iRow].Cells[j].Value = DBUtility.ClsPub.isLong(sWorkQty * ( DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"])));
|
sLeftQty = sLeftQty - DBUtility.ClsPub.isLong(sWorkQty * ( DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"])));
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]);
|
oClsGridValues.Add(oSub);
|
}
|
else
|
{
|
grd.Rows[iRow].Cells[j].Value = sLeftQty;
|
sLeftQty = 0;
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(dsPre.Tables[0].Rows[0]["HUseTimes"]);
|
oClsGridValues.Add(oSub);
|
}
|
}
|
else
|
{
|
if (sLeftQty > sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"]))
|
{
|
grd.Rows[iRow].Cells[j].Value = DBUtility.ClsPub.isLong(sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"]));
|
sLeftQty = sLeftQty - (DBUtility.ClsPub.isLong(sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"])));
|
sLeftQty = 0;
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"]);
|
oClsGridValues.Add(oSub);
|
}
|
else
|
{
|
grd.Rows[iRow].Cells[j].Value = sLeftQty;
|
sLeftQty = 0;
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"]);
|
oClsGridValues.Add(oSub);
|
}
|
}
|
}
|
else
|
{
|
if (sLeftQty > sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"]))
|
{
|
grd.Rows[iRow].Cells[j].Value = DBUtility.ClsPub.isLong(sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"]));
|
sLeftQty = sLeftQty - (DBUtility.ClsPub.isLong(sWorkQty * DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"])));
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"]);
|
oClsGridValues.Add(oSub);
|
}
|
else
|
{
|
grd.Rows[iRow].Cells[j].Value = sLeftQty;
|
sLeftQty = 0;
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = j;
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[i]["Ê£Ó๤ʱ"]);
|
oClsGridValues.Add(oSub);
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
//¼ÆËã½áÊøÈÕÆÚ²¢½«Êý¾ÝÅų̵½Íø¸ñ
|
/// <summary>
|
/// ¼ÆËã½áÊøÈÕÆÚ²¢½«Êý¾ÝÅų̵½Íø¸ñ
|
/// </summary>
|
/// <param name="grd"></param>
|
/// <param name="ds"></param>
|
/// <param name="dsPre"></param>
|
/// <param name="iRow"></param>
|
/// <param name="sLeftQty"></param>
|
/// <param name="sWorkQty"></param>
|
/// <param name="bAddFlag"></param>
|
public static void SetInfoToGridForEndDate(SQLHelper.ClsCN oCn, DataGridView grd, int iRow, ref Single sLeftQty, Single sWorkQty, DateTime dWorkBeginTime,Int64 sSourceID, List<ClsGridValues> oClsGridValues,int FixCols)
|
{
|
//¸ù¾Ý¿ªÊ¼ÈÕÆÚ ¼ÆËã½áÊøÈÕÆÚ
|
DateTime sBTime=Convert.ToDateTime("2000-01-01");
|
DateTime sDate;
|
ClsGridValues oSub;
|
DataSet oDs;
|
//ÕÒµ½¶ÔÓ¦µÄÁÐ
|
int n=0;
|
while (sLeftQty > 0)//¸ù¾Ý Ê£ÓàÊýÁ¿ ¿Û³ýʱ¼ä
|
{
|
if (n > 100)//Ñ»·³¬¹ý50´Î£¬ÈÏΪÊÇËÀÑ»·
|
{
|
break;
|
}
|
//µÃµ½±¾ÈÕ¿ªÊ¼Ê±¼ä
|
if (sBTime < dWorkBeginTime)
|
{
|
sBTime = dWorkBeginTime;
|
}
|
if (sBTime < DateTime.Today)
|
{
|
sBTime = DateTime.Today ;
|
}
|
sDate =Convert.ToDateTime(sBTime.ToShortDateString());
|
//µÃµ½ ±¾ÈÕ ½áÊøÊ±¼ä ºÍ Éú²úÊýÁ¿
|
DateTime dEndTime = Convert.ToDateTime("2000-01-01");
|
Single sRelQty = 0;
|
//
|
if (GetEndTimeByShift( sSourceID, sLeftQty, sWorkQty, ref sBTime, ref dEndTime, ref sRelQty))
|
{
|
if (dEndTime < DateTime.Today)//·µ»Ø´íÎóÐÅÏ¢
|
{
|
break;
|
}
|
}
|
else//ÕÒ²»µ½¿ÉÅÅ×ÊÔ´
|
{
|
break;
|
}
|
//oDs = oCn.RunProcReturn("exec h_p_Sc_GetProcPlanAutoEndTime '" + DBUtility.ClsPub.isDate(sBTime, -1) + "'," + sLeftQty.ToString() + "," + sWorkQty.ToString() + "," + sSourceID.ToString(), "h_p_Sc_GetProcPlanAutoEndTime");
|
//if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
//{
|
// return;
|
//}
|
//
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = 0;
|
for (int j = FixCols; j < grd.ColumnCount; j++)
|
{//ÕÒµ½¶ÔÓ¦ÁÐ
|
if (DBUtility.ClsPub.isStrNull(grd.Columns[j].Tag) == sBTime.ToShortDateString())
|
{
|
oSub.iCol = j;
|
grd.Rows[iRow].Cells[j].Value = sRelQty ;
|
}
|
}
|
//
|
oSub.HLeftTimes = 0;
|
oSub.HBeginTime = sBTime;
|
oSub.HEndTime = dEndTime;
|
oClsGridValues.Add(oSub);
|
//
|
sLeftQty = sLeftQty - sRelQty;
|
//ÊÇ·ñ ³¬Ì죬³¬Ìì ¿ªÊ¼Ê±¼äΪ ´ÎÈÕÉϰàʱ¼ä
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetNextDayBeginTime '" + sBTime + "'," + sSourceID.ToString(), "h_p_Sc_GetNextDayBeginTime");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return;
|
}
|
sBTime = Convert.ToDateTime(DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[0]["HNextBeginTime"], -1));
|
}
|
}
|
|
|
|
//¼ÆËã½áÊøÈÕÆÚ²¢½«Êý¾ÝÅų̵½Íø¸ñ
|
/// <summary>
|
/// ¼ÆËã½áÊøÈÕÆÚ²¢½«Êý¾ÝÅų̵½Íø¸ñ
|
/// </summary>
|
/// <param name="grd"></param>
|
/// <param name="ds"></param>
|
/// <param name="dsPre"></param>
|
/// <param name="iRow"></param>
|
/// <param name="sLeftQty"></param>
|
/// <param name="sWorkQty"></param>
|
/// <param name="bAddFlag"></param>
|
public static void SetInfoToGridForEndDate_Line(int iInStockDays, Int64 iProcPlanInterID,Int64 iProcPlanEntryID, SQLHelper.ClsCN oCn, DataGridView grd, int iRow, ref Single sLeftQty, Single sWorkQty, DateTime dWorkBeginTime, Int64 sSourceID, List<ClsGridValues> oClsGridValues, int FixCols, double dChangeTimes)
|
{
|
//¸ù¾Ý¿ªÊ¼ÈÕÆÚ ¼ÆËã½áÊøÈÕÆÚ
|
DateTime sBTime = Convert.ToDateTime("2000-01-01");
|
DateTime sDate;
|
ClsGridValues oSub;
|
DataSet oDs;
|
//ÕÒµ½¶ÔÓ¦µÄÁÐ
|
Single sLeftWorkTimes = 0;
|
Single sDayWorkQty = 0;//±¾ÈÕ¿ÉÉú²úÊýÁ¿
|
int n = 0;
|
while (sLeftQty > 0)//¸ù¾Ý Ê£ÓàÊýÁ¿ ¿Û³ýʱ¼ä
|
{
|
if (n > 100)//Ñ»·³¬¹ý50´Î£¬ÈÏΪÊÇËÀÑ»·
|
{
|
break;
|
}
|
//µÃµ½±¾ÈÕ¿ªÊ¼Ê±¼ä
|
if (sBTime < dWorkBeginTime)
|
{
|
sBTime = dWorkBeginTime;
|
}
|
if (sBTime < DateTime.Today)
|
{
|
sBTime = DateTime.Today;
|
}
|
sDate = Convert.ToDateTime(sBTime.ToShortDateString());
|
//µÃµ½ ±¾ÈÕ ½áÊøÊ±¼ä ºÍ Éú²úÊýÁ¿
|
DateTime dEndTime = Convert.ToDateTime("2000-01-01");
|
Single sRelQty = 0;
|
Single sClsQty = 0; //»º´æÀàÖеļƻ®ÊýÁ¿
|
//»ñÈ¡µ½±¾ÈÕΪֹ ¿ÉÉú²úÊýÁ¿£¨ÉϵÀ¹¤Ðò×òÌìÒÔǰ ÒѼƻ® - ±¾µÀÒѼƻ®£©
|
if (iProcPlanEntryID > 0)
|
{
|
//ÔÚ ¶ÓÁÐÀï »ñÈ¡ ±¾µÀÒѼƻ® δ±£´æÖÁÊý¾Ý¿âµÄÊýÁ¿
|
|
foreach (ClsGridValues os in oClsGridValues)
|
{
|
if (os.HBeginTime.AddDays(1) <= sBTime)
|
{
|
sClsQty = sClsQty + os.HQty;
|
}
|
}
|
//
|
sDayWorkQty = GetTodayWorkQty(sClsQty, sBTime, iProcPlanInterID, iProcPlanEntryID, ref ClsPub.sExeReturnInfo);
|
//
|
if (sDayWorkQty < 0)
|
{
|
sDayWorkQty = sLeftQty;
|
}
|
else
|
{
|
if (sLeftQty >= sDayWorkQty)
|
{
|
sDayWorkQty = sDayWorkQty;
|
}
|
else
|
{
|
sDayWorkQty = sLeftQty;
|
}
|
}
|
}
|
else//Ê×µÀ¹¤ÐòÔò ²»¿¼ÂÇ
|
{
|
sDayWorkQty = sLeftQty;
|
}
|
//µÃµ½ ±¾ÈÕ ½áÊøÊ±¼ä ºÍ Éú²úÊýÁ¿
|
if (sSourceID == 1114)
|
{
|
sSourceID = sSourceID;
|
}
|
double dUseChangeTimes = 0;
|
if (GetEndTimeByShift_Line(sSourceID, ref sDayWorkQty, ref sLeftWorkTimes, sWorkQty, ref sBTime, ref dEndTime, ref sRelQty, ref dChangeTimes, ref dUseChangeTimes))
|
{
|
//if (dEndTime < DateTime.Today)//·µ»Ø´íÎóÐÅÏ¢
|
//{
|
// break;
|
//}
|
if (sRelQty <= 0)
|
{
|
sBTime = sBTime.AddDays(1);
|
continue;
|
}
|
}
|
else//ÕÒ²»µ½¿ÉÅÅ×ÊÔ´
|
{
|
break;
|
}
|
//
|
oSub = new ClsGridValues();
|
oSub.iRow = iRow;
|
oSub.iCol = 0;
|
for (int j = FixCols; j < grd.ColumnCount; j++)
|
{//ÕÒµ½¶ÔÓ¦ÁÐ
|
if (DBUtility.ClsPub.isStrNull(grd.Columns[j].Tag) == sBTime.ToShortDateString())
|
{
|
oSub.iCol = j;
|
grd.Rows[iRow].Cells[j].Value = sRelQty;
|
|
}
|
}
|
oSub.HQty = sRelQty;
|
//
|
//oSub.HLeftTimes = 0;
|
oSub.HBeginTime = sBTime;
|
oSub.HInStockDays = iInStockDays;
|
//oSub.HEndTime = dEndTime;
|
oSub.HChangeTimes = dUseChangeTimes;
|
oClsGridValues.Add(oSub);
|
//
|
sLeftQty = sLeftQty - sRelQty;
|
//ÊÇ·ñ ³¬Ì죬³¬Ìì ¿ªÊ¼Ê±¼äΪ ´ÎÈÕÉϰàʱ¼ä
|
sBTime = sBTime.AddDays(1);
|
}
|
}
|
|
|
|
|
|
|
|
|
//¸ù¾ÝÅŰà±íºÍÍ£¹¤µ¥ »ñÈ¡ ½áÊøÊ±¼ä
|
public static bool GetEndTimeByShift(Int64 lSourceID, Single lLeftQty, Single lWorkQty,ref DateTime dBTime, ref DateTime dEndTime, ref Single sRelQty)
|
{
|
DataSet oDs;
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
List<ClsShiftValues> oList = new List<ClsShiftValues>();
|
List<ClsShiftValues> oRelList = new List<ClsShiftValues>();
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetProcPlanAutoEndTime_new '" + DBUtility.ClsPub.isDate(dBTime, -1) + "'," + lLeftQty.ToString() + "," + lWorkQty.ToString() + "," + lSourceID.ToString(), "h_p_Sc_GetProcPlanAutoEndTime_new");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return false;
|
}
|
oList.Clear();
|
for (int i = 0; i < oDs.Tables[0].Rows.Count; i++)
|
{
|
ClsShiftValues oSub = new ClsShiftValues();
|
oSub.HAddTime = DBUtility.ClsPub.isSingle(oDs.Tables[0].Rows[i]["¼Ó°àʱ¼ä"]);
|
oSub.HBeginTime =Convert.ToDateTime(DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[i]["¿ªÊ¼Ê±¼ä"],-1));
|
oSub.HEndTime = Convert.ToDateTime(DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[i]["½áÊøÊ±¼ä"], -1));
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(oDs.Tables[0].Rows[i]["Ê£Ó๤ʱ"]);
|
oList.Add(oSub);
|
}
|
//»ñȡͣ¹¤µ¥
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetWorkStopBill '" + DBUtility.ClsPub.isDate(dBTime, -1) + "'," + lSourceID.ToString(), "h_p_Sc_GetProcPlanAutoEndTime_new");
|
if (oDs == null)
|
{
|
//
|
return false;
|
}
|
else
|
{
|
for (int i = 0; i < oDs.Tables[0].Rows.Count; i++)
|
{
|
oRelList.Clear();
|
foreach (ClsShiftValues oSub in oList)
|
{
|
ClsShiftValues oRelSub = new ClsShiftValues();
|
ClsShiftValues oRelSub2 = new ClsShiftValues();
|
if (oSub.HRemoveFlag == false)
|
{
|
if (
|
(DBUtility.ClsPub.TwoDateCompare(oSub.HBeginTime, oDs.Tables[0].Rows[i]["HBeginTime"]) == 1
|
|| DBUtility.ClsPub.TwoDateCompare(oSub.HBeginTime, oDs.Tables[0].Rows[i]["HBeginTime"]) == 0)
|
&& (DBUtility.ClsPub.TwoDateCompare(oSub.HEndTime, oDs.Tables[0].Rows[i]["HEndTime"]) == -1
|
|| DBUtility.ClsPub.TwoDateCompare(oSub.HEndTime, oDs.Tables[0].Rows[i]["HEndTime"]) == 0)
|
)
|
{//1.Í£¹¤¿ªÊ¼ СÓÚµÈÓÚ¿ªÊ¼ Í£¹¤½áÊø´óÓÚµÈÓÚ½áÊø Ö±½Óɾ³ý A<C and B>D
|
oSub.HRemoveFlag = true;
|
}
|
else if (
|
(DBUtility.ClsPub.TwoDateCompare(oSub.HBeginTime, oDs.Tables[0].Rows[i]["HBeginTime"]) == 1
|
|| DBUtility.ClsPub.TwoDateCompare(oSub.HBeginTime, oDs.Tables[0].Rows[i]["HBeginTime"]) == 0)
|
&& (DBUtility.ClsPub.TwoDateCompare(oSub.HEndTime, oDs.Tables[0].Rows[i]["HEndTime"]) == 1
|
)
|
&& (DBUtility.ClsPub.TwoDateCompare(oSub.HEndTime, oDs.Tables[0].Rows[i]["HBeginTime"]) == 1
|
)
|
)
|
{// 2.Í£¹¤¿ªÊ¼ СÓÚµÈÓÚ¿ªÊ¼ Í£¹¤½áÊøÐ¡ÓÚ½áÊø²¢Í£¹¤½áÊø´óÓÚ¿ªÊ¼ Í£¹¤½áÊøÎª¿ªÊ¼ C>A and B>C and B<D
|
oSub.HBeginTime = Convert.ToDateTime(DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[i]["HEndTime"]));
|
oRelSub.HAddTime = oSub.HAddTime;
|
oRelSub.HBeginTime = oSub.HBeginTime;
|
oRelSub.HEndTime = oSub.HEndTime;
|
oRelSub.HLeftTimes = oSub.HLeftTimes;
|
oRelSub.HRemoveFlag = oSub.HRemoveFlag;
|
oRelList.Add(oRelSub);
|
}
|
else if (
|
(DBUtility.ClsPub.TwoDateCompare(oSub.HBeginTime, oDs.Tables[0].Rows[i]["HBeginTime"]) == -1)
|
&& (DBUtility.ClsPub.TwoDateCompare(oSub.HEndTime, oDs.Tables[0].Rows[i]["HEndTime"]) == -1
|
|| DBUtility.ClsPub.TwoDateCompare(oSub.HEndTime, oDs.Tables[0].Rows[i]["HEndTime"]) == 0
|
)
|
)
|
{//3.Í£¹¤¿ªÊ¼ ´óÓÚ¿ªÊ¼ Í£¹¤½áÊø´óÓÚµÈÓÚ½áÊø Í£¹¤¿ªÊ¼Îª½áÊø A>C and B>D
|
oSub.HEndTime = Convert.ToDateTime(DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[i]["HBeginTime"]));
|
oRelSub.HAddTime = oSub.HAddTime;
|
oRelSub.HBeginTime = oSub.HBeginTime;
|
oRelSub.HEndTime = oSub.HEndTime;
|
oRelSub.HLeftTimes = oSub.HLeftTimes;
|
oRelSub.HRemoveFlag = oSub.HRemoveFlag;
|
oRelList.Add(oRelSub);
|
}
|
else if (
|
(DBUtility.ClsPub.TwoDateCompare(oSub.HBeginTime, oDs.Tables[0].Rows[i]["HBeginTime"]) == -1)
|
&& (DBUtility.ClsPub.TwoDateCompare(oSub.HEndTime, oDs.Tables[0].Rows[i]["HEndTime"]) == 1
|
)
|
)
|
{//4.Í£¹¤¿ªÊ¼ ´óÓÚ¿ªÊ¼ Í£¹¤½áÊøÐ¡ÓÚ½áÊø ±äΪ2¶Î ¿ªÊ¼µ½Í£¹¤¿ªÊ¼ Í£¹¤½áÊøµ½½áÊø A>C and B<D
|
oRelSub.HAddTime = oSub.HAddTime;
|
oRelSub.HBeginTime = oSub.HBeginTime;
|
oRelSub.HEndTime = Convert.ToDateTime(DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[i]["HBeginTime"]));
|
oRelSub.HLeftTimes = oSub.HLeftTimes;
|
oRelSub.HRemoveFlag = oSub.HRemoveFlag;
|
oRelList.Add(oRelSub);
|
oRelSub2.HAddTime = oSub.HAddTime;
|
oRelSub2.HBeginTime = Convert.ToDateTime(DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[i]["HEndTime"]));
|
oRelSub2.HEndTime = oSub.HEndTime;
|
oRelSub2.HLeftTimes = oSub.HLeftTimes;
|
oRelSub2.HRemoveFlag = oSub.HRemoveFlag;
|
oRelList.Add(oRelSub2);
|
}
|
else
|
{
|
oRelSub.HAddTime = oSub.HAddTime;
|
oRelSub.HBeginTime = oSub.HBeginTime;
|
oRelSub.HEndTime = oSub.HEndTime;
|
oRelSub.HLeftTimes = oSub.HLeftTimes;
|
oRelSub.HRemoveFlag = oSub.HRemoveFlag;
|
oRelList.Add(oRelSub);
|
}
|
|
}
|
}
|
//Ò»´ÎÑ»·ºó£¬½«rellist¸³Öµ¸ølist
|
oList.Clear();
|
foreach (ClsShiftValues oRSub in oRelList)
|
{
|
ClsShiftValues oFSub = new ClsShiftValues();
|
oFSub.HAddTime = oRSub.HAddTime;
|
oFSub.HBeginTime = oRSub.HBeginTime;
|
oFSub.HEndTime = oRSub.HEndTime;
|
oFSub.HLeftTimes = oRSub.HLeftTimes;
|
oFSub.HRemoveFlag = oRSub.HRemoveFlag;
|
oList.Add(oFSub);
|
}
|
}
|
}
|
//¸ù¾ÝÊ£Óà ʱ¼ä£¬¼ÆËã ½áÊøÊ±¼ä lWorkQty lLeftQty dBTime dEndTime sRelQty
|
Single HourToMin = 60;
|
Single sSumQty = 0;
|
Single sLeftQty = lLeftQty;
|
Single sLeftTime = sLeftQty / lWorkQty * HourToMin; //Ê£ÓàÊýÁ¿ ÐèҪʱ¼ä
|
Single sNowTime = 0;
|
int j = 0;
|
//
|
foreach (ClsShiftValues oSub in oList)
|
{
|
if (sLeftTime > 0)
|
{
|
if (oSub.HBeginTime < dBTime)//Èç¹û¿ª¹¤Ê±¼äСÓÚ ¿ªÊ¼Ê±¼ä
|
{
|
oSub.HBeginTime = dBTime;
|
}
|
else
|
{
|
if (j == 0)
|
{
|
dBTime = oSub.HBeginTime;
|
}
|
}
|
sNowTime = DateDiffMin(oSub.HBeginTime, oSub.HEndTime);
|
if (sNowTime <= 0)
|
{
|
continue;
|
}
|
if (sNowTime >= sLeftTime)//Èç¹ûʱ¼ä¹»
|
{
|
dEndTime = oSub.HBeginTime.AddMinutes(sLeftTime);
|
sSumQty = sSumQty + sLeftQty;
|
sRelQty = sSumQty;
|
break;
|
}
|
else//ʱ¼ä²»¹»
|
{
|
////Ôö¼Ó ¼Ó°àʱ¼äÊÇ·ñ¹»ÓÃ
|
//if (sNowTime + oSub.HAddTime * HourToMin >= sLeftTime)//Èç¹ûʱ¼ä¹»
|
//{
|
// dEndTime = oSub.HBeginTime.AddMinutes(sLeftTime);
|
// sSumQty = sSumQty + sLeftQty;
|
// sRelQty = sSumQty;
|
// break;
|
//}
|
//else //ÈÔ ²»¹»Óà Ôò Õý³£Ï°à
|
//{
|
sLeftQty = sLeftQty - (sNowTime / HourToMin * lWorkQty);
|
sLeftTime = sLeftTime - sNowTime;
|
dEndTime = oSub.HEndTime;
|
sSumQty = sSumQty + (sNowTime / HourToMin * lWorkQty);
|
sRelQty = sSumQty;
|
//}
|
}
|
}
|
j = j + 1;
|
}
|
return true;
|
}
|
|
|
//¸ù¾ÝÅŰà±í »ñÈ¡ ½áÊøÊ±¼ä
|
public static bool GetEndTimeByShift_Line(Int64 lSourceID, ref Single lLeftQty, ref Single sLeftWorkTimes, Single lWorkQty, ref DateTime dBTime, ref DateTime dEndTime, ref Single sRelQty, ref double dChangeTimes, ref double dUseChangeTimes)
|
{
|
DataSet oDs;
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
List<ClsShiftValues> oList = new List<ClsShiftValues>();
|
List<ClsShiftValues> oRelList = new List<ClsShiftValues>();
|
//¸ù¾Ý¿ªÊ¼ÈÕÆÚ »ñÈ¡ µ±ÈÕÊ£Ó๤ʱ
|
oDs = oCn.RunProcReturn("exec h_p_Sc_GetProcPlanAutoEndTime_Line '" + DBUtility.ClsPub.isDate(dBTime, -1) + "'," + lLeftQty.ToString() + "," + lWorkQty.ToString() + "," + lSourceID.ToString(), "h_p_Sc_GetProcPlanAutoEndTime_Line");
|
if (oDs == null || oDs.Tables[0].Rows.Count == 0)
|
{
|
return false;
|
}
|
oList.Clear();
|
for (int i = 0; i < oDs.Tables[0].Rows.Count; i++)
|
{
|
ClsShiftValues oSub = new ClsShiftValues();
|
oSub.HAddTime = 0;
|
oSub.HBeginTime = Convert.ToDateTime(DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[i]["¿ªÊ¼Ê±¼ä"], -1));
|
//oSub.HEndTime = Convert.ToDateTime(DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[i]["½áÊøÊ±¼ä"], -1));
|
oSub.HLeftTimes = DBUtility.ClsPub.isSingle(oDs.Tables[0].Rows[i]["Ê£Ó๤ʱ"]);
|
oList.Add(oSub);
|
}
|
|
//¸ù¾ÝÊ£Óà ʱ¼ä£¬¼ÆËã ½áÊøÊ±¼ä lWorkQty lLeftQty dBTime dEndTime sRelQty
|
double HourToMin = 60;
|
double sSumQty = 0;
|
double sLeftQty = lLeftQty;
|
double sLeftTime = sLeftQty / lWorkQty * HourToMin; //Ê£ÓàÊýÁ¿ ÐèҪʱ¼ä °´·ÖÖÓ
|
double sNowTime = 0;
|
|
|
int j = 0;
|
//
|
double HLeftTimes = 0;
|
foreach (ClsShiftValues oSub in oList)
|
{
|
if (dBTime == oSub.HBeginTime)
|
{
|
if (sLeftTime > 0)
|
{
|
HLeftTimes = (oSub.HLeftTimes * HourToMin) - (dChangeTimes * HourToMin);//Ê£Óàʱ¼ä
|
if (HLeftTimes <= 0)
|
{
|
continue;
|
}
|
if (HLeftTimes >= sLeftTime)//Èç¹ûʱ¼ä¹»
|
{
|
sSumQty = sSumQty + sLeftQty;
|
sRelQty =DBUtility.ClsPub.isSingle(sSumQty);
|
sLeftWorkTimes = DBUtility.ClsPub.isSingle(HLeftTimes - sLeftTime);
|
dUseChangeTimes = dChangeTimes;
|
dChangeTimes = 0;
|
break;
|
}
|
else//ʱ¼ä²»¹»
|
{
|
sLeftQty = sLeftQty - (HLeftTimes / HourToMin * lWorkQty);
|
sLeftTime = sLeftTime - HLeftTimes;
|
sLeftWorkTimes = 0;
|
sSumQty = sSumQty + (HLeftTimes / HourToMin * lWorkQty);
|
sRelQty = DBUtility.ClsPub.isSingle(sSumQty);
|
dUseChangeTimes = dChangeTimes;
|
dChangeTimes = 0;
|
//}
|
}
|
}
|
j = j + 1;
|
}
|
}
|
return true;
|
}
|
|
//2ÈÕÆÚʱ¼ä²îÒì ·ÖÖÓÊý
|
public static int DateDiffMin(DateTime bDate,DateTime eDate)
|
{
|
TimeSpan d3 = eDate.Subtract(bDate);
|
return d3.Days * 480 + d3.Hours * 60 + d3.Minutes;
|
}
|
|
//½»»»ÐÐÄÚÈÝ(Ͻµ)
|
public static void ChangeGridItem(DataGridView grd, int j)
|
{
|
for (int m = 0; m < grd.ColumnCount; m++)
|
{
|
grd.Rows[grd.RowCount - 1].Cells[m].Value = grd.Rows[j].Cells[m].Value;
|
}
|
for (int m = 0; m < grd.ColumnCount; m++)
|
{
|
grd.Rows[j].Cells[m].Value = grd.Rows[j + 1].Cells[m].Value;
|
}
|
for (int m = 0; m < grd.ColumnCount; m++)
|
{
|
grd.Rows[j + 1].Cells[m].Value = grd.Rows[grd.RowCount - 1].Cells[m].Value;
|
}
|
}
|
|
//½»»»ÐÐÄÚÈÝ(ÉÏÉý)
|
public static void ChangeGridItemUp(DataGridView grd, int j)
|
{
|
for (int m = 0; m < grd.ColumnCount; m++)
|
{
|
grd.Rows[grd.RowCount - 1].Cells[m].Value = grd.Rows[j].Cells[m].Value;
|
}
|
for (int m = 0; m < grd.ColumnCount; m++)
|
{
|
grd.Rows[j].Cells[m].Value = grd.Rows[j - 1].Cells[m].Value;
|
}
|
for (int m = 0; m < grd.ColumnCount; m++)
|
{
|
grd.Rows[j - 1].Cells[m].Value = grd.Rows[grd.RowCount - 1].Cells[m].Value;
|
}
|
}
|
|
|
//Ëø¶¨ ½âËø ÈÎÎñµ¥
|
public static void LockICMOBill(bool b, long HICMOInterID, SQLHelper.ClsCN oCn)
|
{
|
if (b)
|
{
|
try
|
{
|
oCn.RunProc("update Sc_WorkBillAutoSortBillMain set HLocked=1 where HICMOInterID=" + HICMOInterID.ToString());
|
return;
|
}
|
catch (Exception e)
|
{
|
return;
|
}
|
}
|
else
|
{
|
try
|
{
|
oCn.RunProc("update Sc_WorkBillAutoSortBillMain set HLocked=0 where HICMOInterID=" + HICMOInterID.ToString());
|
return;
|
}
|
catch (Exception e)
|
{
|
return;
|
}
|
}
|
}
|
|
//»ñÈ¡±¾ÈÕ ¿ÉÉú²úÊýÁ¿
|
/// <summary>
|
/// »ñÈ¡±¾ÈÕ ¿ÉÉú²úÊýÁ¿
|
/// </summary>
|
/// <param name="iSourceInterID"></param>
|
/// <param name="iSourceEntryID"></param>
|
/// <param name="sReturn"></param>
|
/// <returns></returns>
|
public static Single GetTodayWorkQty(Single sClsQty ,DateTime sDate, Int64 iSourceInterID, Int64 iSourceEntryID, ref string sReturn)
|
{
|
try
|
{
|
DataSet ds;
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
ds = oCn.RunProcReturn("exec h_p_Sc_GetTodayWorkQty " + iSourceInterID.ToString() + "," + iSourceEntryID.ToString() + ",'" + sDate.ToShortDateString() + "'," + sClsQty.ToString(), "h_p_Sc_GetTodayWorkQty");
|
if (ds == null || ds.Tables[0].Rows.Count == 0)
|
{
|
return 0;
|
}
|
else
|
{
|
return DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0][0]);
|
}
|
}
|
catch (Exception e)
|
{
|
sReturn = e.Message;
|
return 0;
|
}
|
}
|
|
//»ñÈ¡¹¤Ðò»ã±¨ÊýÁ¿
|
/// <summary>
|
/// »ñÈ¡¹¤Ðò¼Æ»®µ¥ ÒÑ »ã±¨ÊýÁ¿
|
/// </summary>
|
/// <param name="iSourceInterID"></param>
|
/// <param name="iSourceEntryID"></param>
|
/// <param name="sReturn"></param>
|
/// <returns></returns>
|
public static double GetProcessRelationQty(Int64 iSourceInterID, Int64 iSourceEntryID, SQLHelper.ClsCN oCn, ref string sReturn)
|
{
|
try
|
{
|
DataSet ds;
|
ds = oCn.RunProcReturn("exec h_p_Sc_GetProcessReportQty " + iSourceInterID.ToString() + "," + iSourceEntryID.ToString(), "h_p_Sc_GetProcessReportQty");
|
if (ds == null || ds.Tables[0].Rows.Count == 0)
|
{
|
return 0;
|
}
|
else
|
{
|
return DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[0][0]);
|
}
|
}
|
catch (Exception e)
|
{
|
sReturn = e.Message;
|
return 0;
|
}
|
}
|
|
////µÃµ½Áбêʶ
|
//public static int Fun_GetCol(AxVSFlex7.AxVSFlexGrid oGrd, string KeyItem)
|
//{
|
// for (int i = 0; i <= oGrd.Cols - 1; i++)
|
// {
|
// if (KeyItem.Trim().ToLower() == ClsPub.isStrNull(oGrd.get_TextMatrix(0, i)).Trim().ToLower())
|
// return i;
|
// }
|
// return -1;
|
//}
|
//// ¶ÁÈ¡Áпí
|
//public static void GetGrid(AxVSFlex7.AxVSFlexGrid oGrd, string KeyItem, string AppPath)
|
//{
|
|
// int Cols;
|
// char c = Convert.ToChar(",");
|
// string sStr = ClsIni.ReadIni("GridSave", KeyItem, AppPath + @"\" + "grdWidth.wyini");
|
// if (sStr != "ûÓÐÕÒµ½£¡")
|
// {
|
// string[] ColWidth = sStr.Split(c);
|
// if (oGrd.Cols > ColWidth.Length)
|
// {
|
// Cols = ColWidth.Length;
|
// }
|
// else
|
// {
|
// Cols = oGrd.Cols;
|
// }
|
// for (int i = 0; i < Cols; i++)
|
// {
|
// oGrd.set_ColWidth(i, ClsPub.isInt(ColWidth[i]));
|
// }
|
// }
|
// //¶ÁÈ¡¶³½áÁÐ
|
// string n = "";
|
// n = ClsIni.ReadIni("FrozenColSave", KeyItem, AppPath + @"\" + "grdWidth.wyini");
|
// if (n != "" || DBUtility.ClsPub.isInt(n) > 0)
|
// {
|
// oGrd.FrozenCols = DBUtility.ClsPub.isInt(n);
|
// //if (oGrd.Cols > oGrd.FixedCols && oGrd.Rows > oGrd.FixedRows)
|
// //{
|
// // oGrd.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, oGrd.FixedRows, oGrd.FixedCols, oGrd.Rows - 1, oGrd.Cols - 1, ClsPub.Enum_Color.hx_Write);
|
// // oGrd.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, oGrd.FixedRows, oGrd.FixedCols, oGrd.Rows - 1, isInt(n), ClsPub.Enum_Color.hx_Control);
|
|
// //}
|
// }
|
//}
|
////±£´æÁпí
|
//public static void SaveGrid(AxVSFlex7.AxVSFlexGrid oGrd, string KeyItem, string AppPath)
|
//{
|
// int i;
|
// string SaveStr = "";
|
// for (i = 0; i <= oGrd.Cols - 1; i++)
|
// {
|
// if (i == 0)
|
// SaveStr = oGrd.get_ColWidth(i).ToString();
|
// else
|
// SaveStr = SaveStr + "," + oGrd.get_ColWidth(i).ToString();
|
// }
|
// ClsIni oIni = new ClsIni();
|
// if (ClsIni.WriteIni("GridSave", KeyItem, SaveStr, AppPath + @"\" + "grdWidth.wyini"))
|
// SaveStr = "";
|
// //±£´æ¶³½áÁÐ
|
// int n = oGrd.FrozenCols;
|
// if (n >= oGrd.FixedCols)
|
// {
|
// ClsIni.WriteIni("FrozenColSave", KeyItem, n.ToString(), AppPath + @"\" + "grdWidth.wyini");
|
// //if (oGrd.Cols > oGrd.FixedCols && oGrd.Rows > oGrd.FixedRows)
|
// //{
|
// // oGrd.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, oGrd.FixedRows, oGrd.FixedCols, oGrd.Rows - 1, oGrd.Cols - 1, ClsPub.Enum_Color.hx_Write);
|
// // oGrd.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, oGrd.FixedRows, oGrd.FixedCols, oGrd.Rows - 1, isInt(n), ClsPub.Enum_Color.hx_Control);
|
|
// //}
|
// }
|
//}
|
////ĬÈÏÁпí
|
//public static void DefaultGrid(AxVSFlex7.AxVSFlexGrid oGrd)
|
//{
|
// oGrd.AutoSize(0, oGrd.Cols - 1, false, 1);
|
// oGrd.FrozenCols = oGrd.FixedCols;
|
//}
|
|
////Íø¸ñºÏ¼Æ
|
//public static void GridTotal(AxVSFlex7.AxVSFlexGrid grdMain, DataSet DSet)
|
//{
|
// grdMain.SubtotalPosition = VSFlex7.SubtotalPositionSettings.flexSTBelow;
|
// for (int i = 0; i <= DSet.Tables[0].Columns.Count - 1; i++)
|
// {
|
// if (DSet.Tables[0].Columns[i].DataType.ToString() == "System.Double" ||
|
// DSet.Tables[0].Columns[i].DataType.ToString() == "System.Single" ||
|
// DSet.Tables[0].Columns[i].DataType.ToString() == "System.Decimal"
|
// )
|
// {
|
// //ÈôΪÊýÖµÔò ÓÒ¶ÔÆë²¢ÇҺϼÆ
|
// grdMain.set_ColFormat(i + grdMain.FixedCols, "###,###,##0.##");
|
// if (DBUtility.ClsPub.isStrNull(grdMain.get_TextMatrix(0, i + grdMain.FixedCols)).Contains("µ¥¼Û") == false)
|
// {
|
// grdMain.Subtotal(VSFlex7.SubtotalSettings.flexSTSum, -1, i + grdMain.FixedCols, "###,###,##0.00", 15197644, 0, true, "ºÏ¼Æ", 2, false);
|
// }
|
// grdMain.set_ColAlignment(i + grdMain.FixedCols, VSFlex7.AlignmentSettings.flexAlignRightCenter);
|
// }
|
// else if (DSet.Tables[0].Columns[i].DataType.ToString() == "System.Int16" ||
|
// DSet.Tables[0].Columns[i].DataType.ToString() == "System.Int32" ||
|
// DSet.Tables[0].Columns[i].DataType.ToString() == "System.Int64")
|
// {
|
// //ÈôΪÊýÖµÔò ÓÒ¶ÔÆë²¢ÇҺϼÆ
|
// grdMain.Subtotal(VSFlex7.SubtotalSettings.flexSTSum, -1, i + grdMain.FixedCols, 0, 15197644, 0, true, "ºÏ¼Æ", 2, false);
|
// grdMain.set_ColAlignment(i + grdMain.FixedCols, VSFlex7.AlignmentSettings.flexAlignRightCenter);
|
// }
|
// else
|
// {
|
// //·ÇÊýÖµ Ôò×ó¶ÔÆë
|
// grdMain.set_ColAlignment(i + grdMain.FixedCols, VSFlex7.AlignmentSettings.flexAlignLeftCenter);
|
// }
|
// }
|
// //¹Ì¶¨ÐÐ Öмä¶ÔÆë
|
// grdMain.set_FixedAlignment(-1, VSFlex7.AlignmentSettings.flexAlignCenterCenter);
|
//}
|
|
|
//public static void GetGrid(AxVSFlex7.AxVSFlexGrid grdMain, string Name)
|
//{
|
// Sc_ICMOSortBillFun.GetGrid(grdMain, Name, ClsPub.AppPath);
|
//}
|
|
//public static void SaveGrid(AxVSFlex7.AxVSFlexGrid grdMain, string Name)
|
//{
|
// Sc_ICMOSortBillFun.SaveGrid(grdMain, Name, ClsPub.AppPath);
|
//}
|
|
//ÊÇ·ñË¢ÐÂÍø¸ñ
|
/// <summary>
|
/// ÊÇ·ñË¢ÐÂÍø¸ñ
|
/// </summary>
|
/// <param name="grdMain"></param>
|
///// <param name="b">ÕæÎªË¢Ð£¬¼ÙΪ²»Ë¢ÐÂ</param>
|
//public static void IsRedraw(AxVSFlex7.AxVSFlexGrid grdMain, bool b)
|
//{
|
// if (b)
|
// {
|
// grdMain.Redraw = VSFlex7.RedrawSettings.flexRDBuffered;
|
// }
|
// else
|
// {
|
// grdMain.Redraw = VSFlex7.RedrawSettings.flexRDNone;
|
// }
|
//}
|
|
//public static void DefaultGrid(AxVSFlex7.AxVSFlexGrid grdMain, string Name)
|
//{
|
// Sc_ICMOSortBillFun.DefaultGrid(grdMain);
|
// //²ÎÊý½âÊÍ ¿ªÊ¼ÁÐ £¬½áÊøÁУ¬ÊÇ·ñÒÔ×î´óÁпíΪ׼£¬×îСÁпí
|
// Sc_ICMOSortBillFun.SaveGrid(grdMain, Name, ClsPub.AppPath);
|
//}
|
|
//public static Int32 Fun_GetCol(string sCol, AxVSFlex7.AxVSFlexGrid grdMain)
|
//{
|
// for (int c = grdMain.FixedCols; c < grdMain.Cols; c++)
|
// {
|
// if (ClsPub.isStrNull(grdMain.get_TextMatrix(0, c).ToUpper()) == sCol.Trim().ToUpper())
|
// {
|
// return c;
|
// }
|
// }
|
// return 0;
|
//}
|
|
//public static void GraphLine(AxVSFlex7.AxVSFlexGrid grdMain, int MainIDCol, int SubIDCol)
|
//{
|
// long HMainID = 0;
|
// //Ñ»·ËùÓÐÐÐ
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows - 1; i++)
|
// {
|
// if (HMainID == 0)
|
// {
|
// HMainID = ClsPub.isLong(grdMain.get_ValueMatrix(i, MainIDCol).ToString());
|
// }
|
// else
|
// {
|
// if (HMainID == ClsPub.isLong(grdMain.get_ValueMatrix(i, MainIDCol).ToString()))
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpText, i, MainIDCol + 1, i, SubIDCol - 1, "");
|
|
// }
|
// else
|
// {
|
// HMainID = ClsPub.isLong(grdMain.get_ValueMatrix(i, MainIDCol).ToString());
|
// grdMain.Select(i, grdMain.FixedCols, i, grdMain.Cols - 1);
|
// grdMain.CellBorder(14869216, 0, 1, 0, 0, 0, 0);
|
// }
|
// }
|
// }
|
//}
|
|
|
//public static void initGridList(AxVSFlex7.AxVSFlexGrid grdMain, string Name)
|
//{
|
// //
|
// grdMain.Cols = 1;
|
// grdMain.Rows = 1;
|
// grdMain.FixedCols = 1;
|
// grdMain.FixedRows = 1;
|
// grdMain.GridLines = VSFlex7.GridStyleSettings.flexGridNone;
|
// grdMain.ExplorerBar = VSFlex7.ExplorerBarSettings.flexExSortAndMove;
|
// grdMain.AllowBigSelection = false;
|
// grdMain.AllowSelection = false;
|
// grdMain.SelectionMode = VSFlex7.SelModeSettings.flexSelectionByRow;
|
// grdMain.ScrollTrack = true;
|
// grdMain.WordWrap = true;
|
// grdMain.set_ColWidth(-1, 1500);
|
// grdMain.set_RowHeight(-1, 400);
|
// grdMain.set_RowHeight(0, 500);
|
// grdMain.RowHeightMin = 250;
|
// grdMain.Editable = VSFlex7.EditableSettings.flexEDNone;
|
// grdMain.AllowUserResizing = VSFlex7.AllowUserResizeSettings.flexResizeBoth;
|
// grdMain.AllowUserFreezing = VSFlex7.AllowUserFreezeSettings.flexFreezeBoth;
|
// grdMain.set_FixedAlignment(-1, VSFlex7.AlignmentSettings.flexAlignCenterCenter);
|
// grdMain.AutoSizeMode = VSFlex7.AutoSizeSettings.flexAutoSizeColWidth;
|
// //ClsPub.GetGrid(grdMain, Name, ClsPub.AppPath);
|
//}
|
|
////Ìî³äÍø¸ñ
|
//public static void DisplayGridWithTree(AxVSFlex7.AxVSFlexGrid grdMain, DataSet DSet)
|
//{
|
// grdMain.Cols = DSet.Tables[0].Columns.Count + grdMain.FixedCols;
|
// grdMain.set_TextMatrix(0, grdMain.FixedCols - 1, "ÐòºÅ");
|
// grdMain.set_ColWidth(0, 500);
|
// for (int i = 0; i <= DSet.Tables[0].Columns.Count - 1; i++)
|
// {
|
// grdMain.set_TextMatrix(0, i + grdMain.FixedCols, DSet.Tables[0].Columns[i].Caption);
|
// if (DSet.Tables[0].Columns[i].Caption.ToLower().Substring(0, 1) == "h")
|
// {
|
// grdMain.set_ColHidden(i + grdMain.FixedCols, true);
|
// }
|
// else
|
// {
|
// grdMain.set_ColHidden(i + grdMain.FixedCols, false);
|
// grdMain.set_ColWidth(i + grdMain.FixedCols, 1000);
|
// }
|
// }
|
|
// //Ìî³äÍø¸ñ
|
// string s = "";
|
// grdMain.Rows = DSet.Tables[0].Rows.Count + grdMain.FixedRows;
|
// for (int i = 0; i <= DSet.Tables[0].Rows.Count - 1; i++)
|
// {
|
// grdMain.set_TextMatrix(i + grdMain.FixedRows, 0, DSet.Tables[0].Rows[i][0].ToString());
|
// for (int j = 0; j <= DSet.Tables[0].Columns.Count - 1; j++)
|
// {
|
// s = DSet.Tables[0].Rows[i][j].ToString();
|
// grdMain.set_TextMatrix(i + grdMain.FixedRows, j + grdMain.FixedCols, s);
|
// }
|
|
// }
|
// //ÉèÖÃÊ÷ÐÎ
|
// for (int i = grdMain.FixedRows; i < grdMain.Rows; i++)
|
// {
|
// int lev = DBUtility.ClsPub.isInt(grdMain.get_TextMatrix(i,1));
|
// grdMain.set_RowOutlineLevel(i, Convert.ToInt16(lev));
|
// grdMain.set_IsSubtotal(i, true);
|
// }
|
//}
|
|
////Ìî³äÍø¸ñ
|
//public static void DisplayGrid(AxVSFlex7.AxVSFlexGrid grdMain, DataSet DSet)
|
//{
|
// grdMain.Cols = DSet.Tables[0].Columns.Count + grdMain.FixedCols;
|
// grdMain.set_TextMatrix(0, grdMain.FixedCols - 1, "ÐòºÅ");
|
// grdMain.set_ColWidth(0, 500);
|
// for (int i = 0; i <= DSet.Tables[0].Columns.Count - 1; i++)
|
// {
|
// grdMain.set_TextMatrix(0, i + grdMain.FixedCols, DSet.Tables[0].Columns[i].Caption);
|
// if (DSet.Tables[0].Columns[i].Caption.ToLower().Substring(0, 1) == "h")
|
// {
|
// grdMain.set_ColHidden(i + grdMain.FixedCols, true);
|
// }
|
// else
|
// {
|
// grdMain.set_ColHidden(i + grdMain.FixedCols, false);
|
// grdMain.set_ColWidth(i + grdMain.FixedCols, 1000);
|
// }
|
// }
|
|
// //Ìî³äÍø¸ñ
|
// string s = "";
|
// grdMain.Rows = DSet.Tables[0].Rows.Count + grdMain.FixedRows;
|
// for (int i = 0; i <= DSet.Tables[0].Rows.Count - 1; i++)
|
// {
|
// //grdMain.set_TextMatrix(i + grdMain.FixedRows, 0, (i + grdMain.FixedRows).ToString());
|
// for (int j = 0; j <= DSet.Tables[0].Columns.Count - 1; j++)
|
// {
|
// s = DSet.Tables[0].Rows[i][j].ToString();
|
// grdMain.set_TextMatrix(i + grdMain.FixedRows, j + grdMain.FixedCols, s);
|
// }
|
// }
|
//}
|
|
////Ìî³äÍø¸ñ
|
//public static void DisplayGrid(AxVSFlex7.AxVSFlexGrid grdMain, DataSet DSet, bool b)
|
//{
|
// grdMain.Cols = DSet.Tables[0].Columns.Count + grdMain.FixedCols;
|
// grdMain.set_TextMatrix(0, grdMain.FixedCols - 1, "ÐòºÅ");
|
// grdMain.set_ColWidth(0, 500);
|
// for (int i = 0; i <= DSet.Tables[0].Columns.Count - 1; i++)
|
// {
|
// grdMain.set_TextMatrix(0, i + grdMain.FixedCols, DSet.Tables[0].Columns[i].Caption);
|
// if (DSet.Tables[0].Columns[i].Caption.ToLower().Substring(0, 1) == "h")
|
// {
|
// grdMain.set_ColHidden(i + grdMain.FixedCols, true);
|
// }
|
// else
|
// {
|
// grdMain.set_ColHidden(i + grdMain.FixedCols, false);
|
// grdMain.set_ColWidth(i + grdMain.FixedCols, 1000);
|
// }
|
// }
|
|
// //Ìî³äÍø¸ñ
|
// string s = "";
|
// grdMain.Rows = DSet.Tables[0].Rows.Count + grdMain.FixedRows;
|
// for (int i = 0; i <= DSet.Tables[0].Rows.Count - 1; i++)
|
// {
|
// grdMain.set_TextMatrix(i + grdMain.FixedRows, 0, (i + grdMain.FixedRows).ToString());
|
// for (int j = 0; j <= DSet.Tables[0].Columns.Count - 1; j++)
|
// {
|
// s = DSet.Tables[0].Rows[i][j].ToString();
|
// grdMain.set_TextMatrix(i + grdMain.FixedRows, j + grdMain.FixedCols, s);
|
// }
|
// }
|
//}
|
|
|
////µÃµ½¶ÔÓ¦ÁÐ
|
//public static Int32 Fun_GetCol_VS(string sCol, AxVSFlex7.AxVSFlexGrid grdMain)//
|
//{
|
// for (int c = 0; c < grdMain.Cols; c++)
|
// {
|
// if (ClsPub.isStrNull(grdMain.get_TextMatrix(0, c)).ToUpper().Trim() == sCol.Trim().ToUpper())
|
// {
|
// return c;
|
// }
|
// }
|
// return 0;
|
//}
|
|
////³õʼ»¯GRID
|
//public static void initGridVS_Times(AxVSFlex7.AxVSFlexGrid grdMain, ref DateTime BDate, ref DateTime EDate, string Name, ref DateTime XQDate, ComboBox cmbYear)
|
//{
|
// grdMain.Rows = 0;
|
// grdMain.Cols = 0;
|
// for (int r = 0; r <= 22; r = r + 2)
|
// {
|
// grdMain.Cols = 32;
|
// grdMain.Rows = 24;
|
// grdMain.FixedCols = 0;
|
// grdMain.FixedRows = 0;
|
// grdMain.set_TextMatrix(r, 0, "Ô·Ý");
|
// grdMain.set_TextMatrix(r + 1, 0, r / 2 + 1 + "ÔÂ");
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, r, 1, r, grdMain.Cols - 1, ClsPub.Enum_Color.hx_Control);
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, r + 1, 1, r + 1, grdMain.Cols - 1, ClsPub.Enum_Color.hx_Write);
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, r, 0, grdMain.Rows - 1, 0, ClsPub.Enum_Color.hx_Control);
|
// grdMain.ExplorerBar = VSFlex7.ExplorerBarSettings.flexExSortAndMove;
|
// grdMain.AllowBigSelection = false;
|
// grdMain.AllowSelection = false;
|
// grdMain.SelectionMode = VSFlex7.SelModeSettings.flexSelectionFree;
|
// grdMain.ScrollTrack = true;
|
// grdMain.WordWrap = true;
|
// grdMain.set_ColWidth(-1, 450);
|
// grdMain.set_RowHeight(-1, 340);
|
// grdMain.set_RowHeight(0, 340);
|
// grdMain.RowHeightMin = 340;
|
// grdMain.ColWidthMin = 450;
|
// grdMain.Editable = VSFlex7.EditableSettings.flexEDKbdMouse;
|
// grdMain.AllowUserResizing = VSFlex7.AllowUserResizeSettings.flexResizeBoth;
|
// grdMain.AllowUserFreezing = VSFlex7.AllowUserFreezeSettings.flexFreezeBoth;
|
// grdMain.set_FixedAlignment(-1, VSFlex7.AlignmentSettings.flexAlignCenterCenter);
|
// grdMain.AutoSizeMode = VSFlex7.AutoSizeSettings.flexAutoSizeColWidth;
|
// //
|
// BDate = ClsPub.isDate(cmbYear.Text.ToString() + "-" + Convert.ToString(r / 2 + 1) + "-01");
|
// EDate = BDate.AddMonths(1);
|
// EDate = EDate.AddDays(-1);
|
// //
|
// TimeSpan t = EDate - BDate;
|
// DateTime Today = ClsPub.isDate(ClsPub.GetServerDate(0));
|
// for (int c = 1; c <= ClsPub.isInt(t.Days + 1); c++)
|
// {
|
// grdMain.set_TextMatrix(r, c, c.ToString());
|
// XQDate = ClsPub.isDate(cmbYear.Text.ToString() + "-" + Convert.ToString(r / 2 + 1) + "-" + c.ToString());
|
// if (XQDate.DayOfWeek == DayOfWeek.Saturday || XQDate.DayOfWeek == DayOfWeek.Sunday)
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, r, c, r, c, DBUtility.ClsPub.Enum_Color.hx_Green);
|
// }
|
// if (XQDate == Today)
|
// {
|
// grdMain.set_Cell(VSFlex7.CellPropertySettings.flexcpBackColor, r, c, r, c, DBUtility.ClsPub.Enum_Color.hx_Red);
|
// }
|
// }
|
// }
|
// //
|
// Sc_ICMOSortBillFun.GetGrid(grdMain, Name, ClsPub.AppPath);
|
//}
|
|
//±éÀú×ӿؼþ
|
public static void ForEachControl(Control oControl, bool b)
|
{
|
foreach (Control ct in oControl.Controls)
|
{
|
if (ct.HasChildren == true)
|
{
|
ForEachControl(ct, b);
|
}
|
else
|
{
|
switch (ct.GetType().Name)
|
{
|
case "AxVSFlexGrid":
|
try
|
{
|
if (b)
|
{
|
string s = "";
|
//AxVSFlex7.AxVSFlexGrid ogrd;
|
//ogrd = (AxVSFlex7.AxVSFlexGrid)ct;
|
//s = ogrd.get_Cell(VSFlex7.CellPropertySettings.flexcpText, 0, 0, ogrd.Rows - 1, ogrd.Cols - 1).ToString();
|
//Clipboard.Clear();
|
//Clipboard.SetText(s);
|
//MessageBox.Show("¿½±´³É¹¦£¡");
|
return;
|
}
|
else
|
{
|
string s = "";
|
//AxVSFlex7.AxVSFlexGrid ogrd;
|
//ogrd = (AxVSFlex7.AxVSFlexGrid)ct;
|
////Ñ¡Ôñ·¾¶
|
//SaveFileDialog oDlg = new SaveFileDialog();
|
//oDlg.Title = "Êý¾Ýµ¼³ö";
|
//oDlg.Filter = "Êý¾Ý¸ñʽ(*.XLS)|*.XLS|Êý¾Ý¸ñʽ(*.CSV)|*.CSV";
|
//oDlg.ShowDialog();
|
//if (oDlg.FileName.Trim() != "")
|
//{
|
// ogrd.SaveGrid(oDlg.FileName, VSFlex7.SaveLoadSettings.flexFileTabText, true);
|
//}
|
//MessageBox.Show("µ¼³ö³É¹¦£¡");
|
return;
|
}
|
}
|
catch (Exception e)
|
{
|
return;
|
}
|
default:
|
|
break;
|
}
|
}
|
}
|
}
|
|
//ÅÅÐò1 ´óÅÅÐò
|
public static bool SortData_Proc(DataGridView oGrd, int Col1)
|
{
|
//ðÅÝÅÅÐò·¨
|
//Ôö¼ÓÒ»¸ö±¸ÓÃÐÐ
|
oGrd.RowCount = oGrd.RowCount + 1;
|
for (int i = 0; i < oGrd.RowCount - 2; i++)
|
{
|
for (int j = 0; j < oGrd.RowCount - i - 2; j++)
|
{
|
//ÉèÖÃÈÎÎñµ¥ÓÅÏÈÅÅÐò£¬²¢ÉèÖÃÓÅÏÈ(×î³ÙÍ깤ÈÕÆÚ)
|
if (DBUtility.ClsPub.isDate(oGrd.Rows[j].Cells[Col1].Value) > DBUtility.ClsPub.isDate(oGrd.Rows[j + 1].Cells[Col1].Value))
|
{
|
Sc_ICMOSortBillFun.ChangeGridItem(oGrd, j);
|
}
|
}
|
}
|
//ɾ³ý±¸ÓÃÐÐ
|
oGrd.RowCount = oGrd.RowCount - 1;
|
return true;
|
}
|
|
//ÅÅÐò2 СÅÅÐò
|
public static bool SortData_Proc(DataGridView oGrd, int Col1, int Col2)
|
{
|
//
|
//¸ù¾Ý¿ª¹¤ÈÕÆÚ ÅÅÐò
|
string otime = ClsPub.isDate("1900-01-01").ToShortDateString();
|
int BRow = 0;
|
int ERow = 0;
|
//
|
for (int i = 0; i < oGrd.Rows.Count; i++)
|
{
|
if (ERow == 0)
|
{
|
ERow = 1;
|
otime = DBUtility.ClsPub.isStrNull(oGrd.Rows[i].Cells[Col1].Value);
|
continue;
|
}
|
if (otime != DBUtility.ClsPub.isStrNull(oGrd.Rows[i].Cells[Col1].Value))
|
{
|
otime = DBUtility.ClsPub.isStrNull(oGrd.Rows[i].Cells[Col1].Value);
|
|
//ðÅÝÅÅÐò·¨
|
oGrd.RowCount = oGrd.RowCount + 1;
|
for (int r = BRow; r < ERow; r++)
|
{
|
for (int j = BRow; j < ERow; j++)
|
{
|
//ÉèÖÃÈÎÎñµ¥ÓÅÏÈÅÅÐò£¬²¢ÉèÖÃÓÅÏÈ(×î³ÙÍ깤ÈÕÆÚ+¶©µ¥½»»õÆÚ)
|
if (DBUtility.ClsPub.isDoule(oGrd.Rows[j].Cells[Col2].Value) > DBUtility.ClsPub.isDoule(oGrd.Rows[j + 1].Cells[Col2].Value))
|
{
|
Sc_ICMOSortBillFun.ChangeGridItem(oGrd, j);
|
}
|
}
|
}
|
//ɾ³ý±¸ÓÃÐÐ
|
oGrd.RowCount = oGrd.RowCount - 1;
|
break;
|
}
|
else
|
{
|
ERow = i;
|
}
|
if (i == oGrd.Rows.Count - 1)
|
{
|
//ðÅÝÅÅÐò·¨
|
oGrd.RowCount = oGrd.RowCount + 1;
|
for (int r = BRow; r < ERow; r++)
|
{
|
for (int j = BRow; j < ERow; j++)
|
{
|
//ÉèÖÃÈÎÎñµ¥ÓÅÏÈÅÅÐò£¬²¢ÉèÖÃÓÅÏÈ(×î³ÙÍ깤ÈÕÆÚ+¶©µ¥½»»õÆÚ)
|
if (DBUtility.ClsPub.isDoule(oGrd.Rows[j].Cells[Col2].Value) > DBUtility.ClsPub.isDoule(oGrd.Rows[j + 1].Cells[Col2].Value))
|
{
|
Sc_ICMOSortBillFun.ChangeGridItem(oGrd, j);
|
}
|
}
|
}
|
//ɾ³ý±¸ÓÃÐÐ
|
oGrd.RowCount = oGrd.RowCount - 1;
|
}
|
}
|
return true;
|
}
|
|
|
|
|
}
|
}
|