📄 productresultlist.h
字号:
DataView* myDataView = dynamic_cast<DataView*>(
(dynamic_cast<CurrencyManager*>(
myGrid->BindingContext->Item[myGrid->DataSource,
myGrid->DataMember]))->List);
// This works only with System::Data::DataTable.
if (myDataView == 0)
return;
// If the user already added a column with the name
// then exit. Otherwise, add the column and set the
// expression to the value passed to this function.
DataColumn* col =
myDataView->Table->Columns->Item[S"__Computed__Column__"];
if (col != 0)
return;
col = new DataColumn(String::Concat(
S"__Computed__Column__", __box(count)));
myDataView->Table->Columns->Add(col);
col->Expression = value;
expressionColumn = col;
}
// the OnPaint method to paint the cell based on the expression.
protected:
void Paint(Graphics* g, Rectangle bounds,
CurrencyManager* source, int rowNum,
Brush* backBrush, Brush* foreBrush,
bool alignToRight) {
bool trueExpression = false;
bool hasExpression = false;
DataRowView* drv = dynamic_cast<DataRowView*>(source->List->Item[rowNum]);
hasExpression = this->expressionColumn != 0 &&
this->expressionColumn->Expression != 0 &&
!this->expressionColumn->Expression->Equals(String::Empty);
Console::WriteLine(String::Format(S"hasExpressionValue {0}", __box(hasExpression)));
// Get the value from the expression column.
// For simplicity, we assume a True/False value for the
// expression column.
if (hasExpression) {
Object* expr = drv->Row->Item[expressionColumn->ColumnName];
trueExpression = expr->Equals(S"True");
}
// Let the DataGridBoolColumn do the painting.
if (!hasExpression)
DataGridTextBoxColumn::Paint(g, bounds, source, rowNum,
backBrush, foreBrush, alignToRight);
// Paint using the expression color for true or false, as calculated.
if (trueExpression)
DataGridTextBoxColumn::Paint(g, bounds, source, rowNum,
trueBrush, foreBrush, alignToRight);
else
DataGridTextBoxColumn::Paint(g, bounds, source, rowNum,
falseBrush, foreBrush, alignToRight);
}
};
/// <summary>
/// ProductResultList 偺奣梫
///
/// 寈崘 : 偙偺僋儔僗偺柤慜傪曄峏偡傞応崌丄偙偺僋儔僗偑埶懚偡傞偡傋偰偺 .resx 僼傽僀儖偵娭楢晅偗傜傟偨
/// 儅僱乕僕 儕僜乕僗 僐儞僷僀儔 僣乕儖偵懳偟偰 'Resource File Name' 僾儘僷僥傿傪
/// 曄峏偡傞昁梫偑偁傝傑偡丅偙偺曄峏傪峴傢側偄偲丄
/// 僨僓僀僫偲丄偙偺僼僅乕儉偵娭楢晅偗傜傟偨儘乕僇儔僀僘嵪傒儕僜乕僗偲偑丄
/// 惓偟偔憡屳偵棙梡偱偒側偔側傝傑偡丅
/// </summary>
/*private __gc class DongDBBase : public DBBase
{
}*/
public __gc class ProductResultList : public System::Windows::Forms::Form
{
public:
ProductResultList(void)
{
InitializeComponent();
}
ProductResultList(infClass * infClsTmp,int rank)//rank is decide which person of rank enter into this form,value 0 is for worker,1,2 is sequently for mananger and administrator
{
InitializeComponent();
oInf = infClsTmp;
iLanguage = oInf->intLang;
sFactory = oInf->strFactoryCode;
sLine = oInf->strLine;
sProcess = oInf->strProcess;
iGroup = oInf->intGroup;
cShift = oInf->strShift;
insiderank = rank;
}
private:
//Global Palameter
int insiderank;//decide which person of rank enter into this form,value 0 is for worker,1,2 is sequently for mananger and administrator
int iLanguage;
String* sFactory;
String* sLine;
String* sProcess;
int iGroup;
String* cShift;
infClass* oInf;
DBBase* oDB;
DataSet* oDataSet;
//张///////开始
//按日全局SQL
String * sMySQLDay;
String * sMySQLDay2;
//按月全局SQL
String * sMySQLMonth;
String * sMySQLMonth2;
long sumTotalPlan1;
//张////////结束
//String * allpqty;
//extra owner defined
//static String* scheduleNum[] = {S"生产计划", S"生産予定", S"production schedule"};
//static String* resultNum[] = {S"生产实际", S"生産実績", S"production result"};
//static String* dateLetter[] = {S"日期", S"日付", S"date"};
static String* secDate[] = {S"计划日期", S"計画日付", S"schedule date"};
private:
DataGridTableStyle* oTableStyleMain;
DataSet* oDataSetMain;
DataTable* oDataTableMain;
//合计
DataSet* hejiDS;
DataTable* hejiDT;
DataGridTableStyle* oTableStyleMinor;
DataSet* oDataSetMinor;
DataTable* oDataTableMinor;
private: System::Windows::Forms::DateTimePicker * dateTimePickerFrom;
private: System::Windows::Forms::DateTimePicker * dateTimePickerTo;
private: System::Windows::Forms::Label * label3;
private: System::Windows::Forms::DataGrid * dataGridMainForMonth;
private: System::Windows::Forms::DataGrid * dataGridMainForDay;
private: System::Windows::Forms::ComboBox * comboBox1;
private: System::Windows::Forms::Label * label4;
private: System::Windows::Forms::Label * label5;
private: System::Windows::Forms::ComboBox * comboBox2;
private: System::Windows::Forms::Label * label6;
private: System::Windows::Forms::Button * btnSearch;
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::Button * button2;
private: System::Windows::Forms::Label * lbl_Title;
private: System::Windows::Forms::Button * button3;
private: System::Windows::Forms::Label * label1;
private: System::Windows::Forms::Label * label2;
private: System::Windows::Forms::ComboBox * comboBoxProcessNum;
private: System::Windows::Forms::ComboBox * comboBoxUnit;
/*DataGridMain is left datagrid DataGridMinor is right datagrid
DataGridMainForDay is for when the (day,month) comobox's day is selected DataGridMinorForDay is for when left main datagrid's DataGridMainForDay is clicked
DataGridMinorForMonth is for when the (day,month) comobox's month is selected DataGridMinorForMonth
*/
private:
void InitProductResultList();
void GetDataGridMainForDay(String* sProcessNo);
void GetDataGridMainForMonth(String* sProcessNo);
void GetDataGridMinorForDay(String* sProcessNo);
void GetDataGridMinorForMonth(String* sProcessNo);
void SetValueComboBoxProcessNum();
void SetValueComboBoxUnit();
void InitGridMainForDay(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -