| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.Threading;
- using System.Collections;
- using System.Reflection;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.StlMes.Client.Sale.UI.Balance.BalanceAccount
- {
- public partial class FrmBalanceTicketMgt : Core.StlMes.Client.Sale.Common.FrmStyleBase.FrmUIBase
- {
- public FrmBalanceTicketMgt()
- {
- InitializeComponent();
- }
- private String cusInfo = "";
- private String suppunit = "";
- private string _key = "2";
- private void SetKey()
- {
- if (this.CustomInfo.Length > 0)
- {
- this._key = this.CustomInfo.Trim().Split('_')[0];
- }
- }
- //待结算单据管理(结算价维护) 1
- //待结算单据管理(结算编单) 2
- private void HiddenToolbars()
- {
-
- try
- {
- foreach ( Infragistics.Win.UltraWinToolbars.ToolBase tb in toolMenu.Toolbars[0].Tools)
- {
- if (tb.Key == "QueryUnAcept" || tb.Key == "Accept" || tb.Key == "Exit" || tb.Key == "Export")
- {
- continue;
- }
- else
- tb.SharedProps.Visible = false;
- }
-
-
- }
- catch
- {
- }
- try
- {
- this.ultraExpandableGroupBox1.Visible = false;
- this.toolMenu.Toolbars[0].Tools["UpdatePrice"].SharedProps.Visible = false;
- this.toolMenu.Toolbars[0].Tools["RollBack"].SharedProps.Visible = false;
- this.toolMenu.Toolbars[0].Tools["SavePrice"].SharedProps.Visible = false;
-
- }
- catch
- { }
-
- if (this._key == "1")
- {
- try
- {
- this.label4.Visible = false;
- this.textBox2.Visible = false;
- this.ultraExpandableGroupBox2.Visible = false;
- this.toolMenu.Toolbars[0].Tools["UpdatePrice"].SharedProps.Visible = false;
- this.toolMenu.Toolbars[0].Tools["RollBack"].SharedProps.Visible = false;
- this.toolMenu.Toolbars[0].Tools["Invoice"].SharedProps.Visible = false;
- this.toolMenu.Toolbars[0].Tools["UnAffrim"].SharedProps.Visible = false;
- this.toolMenu.Toolbars[0].Tools["Affrim"].SharedProps.Visible = false;
-
- }
- catch
- { }
- }
-
-
-
- }
- private string LISTNUMBER = "LISTNUMBER";
- private void AcceptTicket()
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
- if (this.ultraGrid5.Rows.Count == 0)
- return;
- ugr = this.ultraGrid5.ActiveRow;
- if (ugr == null)
- ugr = this.ultraGrid5.Rows[0];
- ugr.Selected = true;
- ArrayList listask = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugs in this.ultraGrid5.Selected.Rows)
- {
- listask.Add(ugs.Cells[LISTNUMBER].Value.ToString());
- }
- // string askPlanId = ugr.Cells[StaticData.TbColumnAndCaption.ASKPLAN_ID].Value.ToString();
- if (Util.MessageUtil.ShowYesNoAndQuestion("是否接收选定行?") == DialogResult.No) return;
- string errMsg = "";
- this.slmBalanceInfo.AffrimAcceptTicket(listask, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
- if (errMsg.Length == 0)
- {
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- this.QueryUnAcceptTicket();
-
- }
- }
- private void UnAcceptTicket()
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- ugr = this.ultraGrid1.Rows[0];
- if (ugr == null)
- {
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowError("请选择需要取消的行");
- return;
- }
- // string askPlanId = ugr.Cells[StaticData.TbColumnAndCaption.ASKPLAN_ID].Value.ToString();
- if (Util.MessageUtil.ShowYesNoAndQuestion("是否取消接收选定行?") == DialogResult.No) return;
- string errMsg = "";
- this.slmBalanceInfo.UnAffrimAcceptTicket(ugr.Cells[this.LISTNUMBER].Value.ToString(), CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
- if (errMsg.Length == 0)
- {
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- try
- {
- string listnum = ugr.Cells[this.LISTNUMBER].Value.ToString();
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugs in this.ultraGrid1.Rows)
- {
- if (ugs.Cells[this.LISTNUMBER].Value.ToString() == listnum)
- {
- list.Add(ugs);
- }
-
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugg in list)
- {
- ugg.Delete();
- }
- }
- catch
- {
- }
- }
- }
-
- private Infragistics.Win.ValueList GetAgenCyFlList()
- {
- Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
- lit.ValueListItems.Add("0", "否");
- lit.ValueListItems.Add("1", "是");
- return lit;
- }
- private Infragistics.Win.ValueList GetStatusList()
- {
- Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
- lit.ValueListItems.Add("0", "未确认");
- lit.ValueListItems.Add("1", "确认");
- lit.ValueListItems.Add("2", "编单");
- return lit;
- }
- private Infragistics.Win.ValueList GetPriceStatusList()
- {
- Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
- lit.ValueListItems.Add("0", " 无效");
- lit.ValueListItems.Add("1", " 有效");
- return lit;
- }
- private Infragistics.Win.ValueList GetBalStatusList()
- {
- Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
- lit.ValueListItems.Add("0", "未确认");
- // lit.ValueListItems.Add("1", "确认");
- lit.ValueListItems.Add("2", "确认");
- lit.ValueListItems.Add("3", "编单");
- return lit;
- }
- private Infragistics.Win.ValueList GetFst_Drawee_unit()
- {
- Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
- lit.ValueListItems.Add("120601", "N/A");
- lit.ValueListItems.Add("120602", "/");
- lit.ValueListItems.Add("120603", "天津钢管集团股份有限公司");
- lit.ValueListItems.Add("120604", "天津钢管钢铁贸易有限公司");
- lit.ValueListItems.Add("120605", "天津钢管国际经济贸易有限公司");
- lit.ValueListItems.Add("120606", "合同结算单位");
- lit.ValueListItems.Add("120607", "江苏天淮钢管有限公司");
- lit.ValueListItems.Add("120608", "天津钢管制造有限公司");
- return lit;
- }
- private string[] GetGridFourDataStruct()
- {
- return new string[]
- {
- "ASKPLAN_ID",
- "TALLYSHEET_NO",
- "BATCH_NO",
- "QUANTITY",
- "ACT_WGT" ,
- "OUTSTOCKMNY",
- "MONEY_TYPE",
- "AGENCY_FL",
- "DELVRY_ADDR",
- "RECEIV_ADDR"
- };
- }
- protected override List<string> GetNumberColumn()
- {
- return new List<string>(new string[] {
- "SEND_NUM",
- "MONEY",
- "WEIGHT",
- "QUANTITY",
- "ACT_WGT",
- "OUTSTOCKMNY",
- "TRANSMNY",
- "PRICE",
- "PRICE_ORG",
- "MONEY_ORG",
- });
- }
-
- private DataSet dsBalanceMain = new DataSet ();
- private Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Balance.SlmBalanceInfo slmBalanceInfo = null;
- DataSet dsGridThree = new DataSet();
- DataSet dsGridFour = new DataSet();
- DataSet dsGridUnAccept = new DataSet();
- private void FrmBalanceTicketMgt_Load(object sender, EventArgs e)
- {
- this.ultraExpandableGroupBox1.Visible = false;
- this.ultraExpandableGroupBox2.Visible = true;
- this.dateTimePicker1.Value = System.DateTime.Now.AddMonths(-1);
- SetKey();
- this.Init();
- this.dsBalanceMain = base.GetDataSetByColumnName(this.GetGrid1DataStruct(),
- null, GetColumnAndCaption());
- this.ultraGrid1.DataSource = dsBalanceMain;
- this.dsGridThree = base.GetDataSetByColumnName(this.GetGridThreeDataStruct(),
- StaticData.TbColumnAndCaption.GetDataSetColumnType(), StaticData.TbColumnAndCaption.GetColumnAndCaption());
- this.ultraGrid3.DataSource = dsGridThree;
- dsGridFour = base.GetDataSetByColumnName(this.GetGridFourDataStruct(),
- StaticData.TbColumnAndCaption.GetDataSetColumnType(), StaticData.TbColumnAndCaption.GetColumnAndCaption());
- // this.ultraGrid4.DataSource = dsGridFour;
- slmBalanceInfo = new Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Balance.SlmBalanceInfo(this.ob);
- this.dsGridFine = base.GetDataSetByColumnName(this.GetGridFiveDataStruct(),
- StaticData.TbColumnAndCaption.GetDataSetColumnType(), StaticData.TbColumnAndCaption.GetColumnAndCaption());
- // this.ultraGrid2.DataSource = dsGridFine;
- this.ultraGrid1.DisplayLayout.GroupByBox.Hidden = true;
- dsGridUnAccept = base.GetDataSetByColumnName(GetUnAcceptBalaceColumn(),
- null, GetColumnAndCaption());
- this.ultraGrid5.DataSource = dsGridUnAccept;
- HiddenColumn();
- InitGrid();
- base.SetGridStyle(ref this.ultraGrid1, ref this.ultraGrid3,ref this.ultraGrid5);
- cusInfo = CustomInfo.Split('_')[0];
- if (CustomInfo.Split('_').Length > 1)
- suppunit = CustomInfo.Split('_')[1];
-
- SetGridShowLength();
- if (this.cusInfo == "2")
- {
- this.ultraTabControl1.Tabs[0].Visible = true;
-
- }
- else
- {
- if (base.GetSaleOrgDesc() == "国贸公司" || suppunit == "120504")
- this.ultraTabControl1.Tabs[0].Visible = true;
- else
- {
- this.ultraTabControl1.Tabs[0].Visible = false;
-
-
- }
-
- }
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[this.ASKPLAN_ID].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["LISTNUMBER"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
-
- }
-
- private void InitGrid()
- {
- try
- {
- // this.ultraGrid4.DisplayLayout.Bands[0].Columns["AGENCY_FL"].ValueList = GetAgenCyFlList();
- }
- catch
- { }
- try
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CONTAIN_TAX"].ValueList = GetAgenCyFlList();
- }
- catch
- { }
- try
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["TICKETSTATUS"].ValueList = GetAgenCyFlList();
- }
- catch
- { }
- try
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["BALANCESTATUS_ORG"].ValueList = GetBalStatusList();
- }
- catch
- { }
- try
- {
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns["STATUS_CD"].ValueList = GetStatusList();
- }
- catch
- { }
- try
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["FST_DRAWEE_UNIT"].ValueList = GetFst_Drawee_unit();
- }
- catch
- { }
- try
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[this.BALNCE_PRICE_STS].ValueList = GetPriceStatusList();
-
- }
- catch
- { }
- try
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[this.BALNCE_PRICE_ORG_STS].ValueList = GetPriceStatusList();
-
- }
- catch
- { }
-
-
-
- }
- private void HiddenColumn()
- {
- try
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["BALANCESTATUS"].Hidden = true;
- // this.ultraGrid1.DisplayLayout.Bands[0].Columns["BALANCESTATUS_ORG"].Hidden = true;
-
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[this.ADJUSTPRICEREASON].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ADJUSTPRICEREASON"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[BUYERCODE].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ADJUSTPRICEPERSON"].Hidden = true;
-
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_PK"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_LN_PK"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ORD_LN_DLY_PK"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["CUSTOMER_NO"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["SALE_AREA_NO"].Hidden = true;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["STD_STYLE"].Hidden = true;
- }
- catch
- { }
- }
- private DataSet dsGridFine = new DataSet();
- private Hashtable hstransFee = new Hashtable();
- private void QueryGridFour()
- {
- this.dsGridFour.Clear();
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- ugr = this.ultraGrid1.Rows[0];
- string orderno = ugr.Cells[StaticData.TbColumnAndCaption.ORD_NO].Value.ToString();
- string orderseq = ugr.Cells[StaticData.TbColumnAndCaption.ORD_SEQ].Value.ToString();
- string orderlineseq = ugr.Cells[StaticData.TbColumnAndCaption.ORD_LN_DLY].Value.ToString();
- string askplanid = ugr.Cells[StaticData.TbColumnAndCaption.ASKPLAN_ID].Value.ToString();
- string askplanidseq = ugr.Cells[StaticData.TbColumnAndCaption.ASKPLAN_ID_SEQ].Value.ToString();
- string spetkey = ugr.Cells[StaticData.TbColumnAndCaption.SPETKEY].Value.ToString();
- string steelkey = ugr.Cells[StaticData.TbColumnAndCaption.STEELCODEKEY].Value.ToString();
- DataSet dsDetail =
- this.slmBalanceInfo.GetSlmBalanceDetailAllGroupByBatchNo(
- orderno, orderseq, orderlineseq, askplanid, askplanidseq, spetkey, steelkey);
- Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsGridFour, dsDetail);
-
- }
- private void QueryGridFive()
- {
- this.dsGridFine.Clear();
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- ugr = this.ultraGrid1.Rows[0];
- string askPlanId = ugr.Cells[StaticData.TbColumnAndCaption.ASKPLAN_ID].Value.ToString();
- DataSet ds = null;
-
- ds = this.slmBalanceInfo.GetSlmBalanceTransMoneyAskPlanid(askPlanId);
-
-
- ds = Util.UtilDataSet.GetDataSetWithRowFilter(ds, "MONEY_TYPE", "运费");
- Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsGridFine, ds);
- }
-
- private void Init()
- {
- try
- {
- this.radioButton1.Checked = true;
- }
- catch
- { }
- }
- private Hashtable GetHashTableByImpExcel()
- {
- Hashtable hs = new Hashtable();
- string fileName = Util.UtilExcel.GetExcelFileName();
- if (fileName.Length == 0)
- return hs;
- DataSet ds = Util.UtilExcel.ToDataSet(fileName);
- if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
- return hs;
- string key = "";
- foreach (DataRow dr in ds.Tables[0].Rows)
- {
- key = dr[0].ToString() + dr[1].ToString() + dr[2].ToString();
- if (!hs.ContainsKey(key))
- {
- hs.Add(key,dr[3].ToString());
- }
-
- }
- return hs;
- }
- private string GetSqlStr(string price,string person,string condition)
- {
- String sqlStr = @" update SLM_BALANCEINFO set PRICE_ORG = nvl({1},0),
- MONEY_ORG = round(nvl({1},0) * weight ,5),
- PRICE_INPUTPERSON_ORG = '{2}' ,PRICE_INPUTPEDATE_ORG = sysdate,PRICE_PRE_ORG = {1}
- where ORD_NO||ORD_SEQ||ORD_LN_DLY||ASKPLAN_ID||ASKPLAN_ID_SEQ||spetKey||steelCodeKey = '{0}'
- and forecorpcode = '国贸公司' and balancestatus_org = '0' ";
- sqlStr = string.Format(sqlStr, condition, price, person);
- return sqlStr;
- }
- private void BatchUPdateBalancePrice()
- {
- if (this.ultraGrid1.Selected.Rows.Count == 0)
- {
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowError("请选择需要保存价格的行");
- return;
- }
- if (this.radioButton2.Checked)
- {
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowError("只允许保存未接收数据价格");
- return;
- }
- Hashtable hsOrderPrice = GetHashTableByImpExcel();
- if (hsOrderPrice.Count == 0)
- return;
- ArrayList sqllist = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
- {
- string sql = "";
- string key = ugr.Cells["CATEGORY"].Value.ToString().Trim() + ugr.Cells["STEELCODEKEY"].Value.ToString().Trim() + ugr.Cells["MODEL_DESC"].Value.ToString().Trim();
- string orderno = ugr.Cells[this.ORD_NO].Value.ToString();
- string ord_seq = ugr.Cells[this.ORD_SEQ].Value.ToString();
- string ord_ln = ugr.Cells[this.ORD_LN_DLY].Value.ToString();
- string askplanId = ugr.Cells[this.ASKPLAN_ID].Value.ToString();
- string askPlanIdSeq = ugr.Cells[this.ASKPLAN_ID_SEQ].Value.ToString();
- string spetKey = ugr.Cells[this.SPETKEY].Value.ToString();
- string steelcodekey = ugr.Cells[this.STEELCODEKEY].Value.ToString();
- string person = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- string price = "0";
- if (hsOrderPrice.ContainsKey(key))
- {
- price = hsOrderPrice[key].ToString();
- if (Core.StlMes.Client.Sale.Util.ConverObject.ConvertToDouble(price) == 0)
- continue;
-
- }
- if (price == "0")
- continue;
- sql = GetSqlStr(price, person, orderno + ord_seq + ord_ln + askplanId + askPlanIdSeq + spetKey + steelcodekey);
- sqllist.Add(sql);
- }
- if (sqllist.Count > 0)
- {
- base.ExecuteNoReader(sqllist);
- this.QueryOrg();
- }
-
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- {
- this.Query();
- break;
- }
- case "QueryUnAcept":
- {
- this.QueryUnAcceptTicket();
- break;
- }
- case "QueryOrg":
- {
- this.QueryOrg();
- break;
- }
- case "Affrim":
- {
- this.Affrim();
- break;
- }
- case "AffrimOrg":
- {
- this.AffrimOrg();
- break;
- }
- case "UnAffrim":
- {
- this.UnAffrim();
- break;
- }
- case "UnAffrimOrg":
- {
- this.UnAffrimOrg();
- break;
- }
- case "Exit":
- {
- this.Close();
- break;
- }
- case "Invoice":
- {
- InvoiceWithTranMny();
- // this.Invoice();
- break;
- }
- case "InvoiceOrg":
- {
- this.InvoiceOrg();
- // this.Invoice();
- break;
- }
- case "InvoiceGuoMao":
- {
- this.InvoiceGuom();
- // this.Invoice();
- break;
- }
- case "InvoiceWithTranMny":
- {
- InvoiceWithTranMny();
- break;
- }
- case "UpdatePrice":
- {
- this.UpdatePrice();
- break;
- }
- case "SavePrice":
- {
- this.InputPrice();
- break;
- }
- case "RollBack":
- {
- this.RollBackAskPlanId();
- break;
- }
- case "Export":
- {
- Util.UtilUltraGrid.ExportGridDataToExcel(this.Text, this.ultraGrid1);
- break;
- }
- case "SetPrice":
- {
- SetBalPrice();
- break;
- }
- case "SetPriceOrg":
- {
- SetBalPriceOrg();
- break;
- }
- case "ExportPrice":
- {
- BatchUPdateBalancePrice();
- break;
- }
- case "Accept":
- {
- AcceptTicket();
- break;
- }
- case "UnAccept":
- {
- UnAcceptTicket();
- break;
- }
- case "AcpRllRecord":
- {
- AccetpRollCreditRecord();
- break;
- }
-
- }
- }
- private void AccetpRollCreditRecord()
- {
- try
- {
- DlgBox.DlgCredit dlgCredit
- = new Core.StlMes.Client.Sale.UI.Balance.DlgBox.DlgCredit(this.ob);
- if (this.cusInfo == "3")
- dlgCredit.SetFlag("2");
- dlgCredit.ShowDialog();
- }
- catch
- {
- }
- }
- private void SetBalPriceOrg()
- {
- ArrayList listOrder = GetUpdateCondition();
- if (listOrder.Count == 0)
- return;
- //foreach (string[] s in listOrder)
- //{
- // this.slmBalanceInfo.SetBalPriceOrg(new ArrayList() { s }, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- //}
- this.slmBalanceInfo.SetBalPriceOrg(listOrder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- this.QueryOrg();
- }
- /// <summary>
- /// 重新获取结算明细价格,防止因维护不及时无法获取正确价格
- /// </summary>
- private void SetBalPrice()
- {
- ArrayList listOrder = GetUpdateCondition();
- if (listOrder.Count == 0)
- return;
- //foreach (string[] s in listOrder)
- //{
- // this.slmBalanceInfo.SetBalPrice(new ArrayList() { s}, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- //}
- this.slmBalanceInfo.SetBalPrice(listOrder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- this.Query();
- }
- private void InvoiceWithTranMny()
- {
- if (!IsCanBeInvoiced())
- return;
- ArrayList listOrder = GetUpdateCondition();
- if (listOrder.Count == 0)
- return;
- if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定编制结算单?") == DialogResult.No) return;
- string errMsg = "";
- this.slmBalanceInfo.InvoiceLightly(listOrder, "", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
- if (errMsg.Length > 0)
- {
- }
- else
- {
- removeUgr();
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- }
- // this.Query();
- }
- private void InvoiceOrg()
- {
- if (!this.IsCanBeInvoicedOrg())
- return;
- ArrayList listOrder = GetUpdateConditionSaleOrg();
- if (listOrder.Count == 0)
- return;
- if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定编制结算单?") == DialogResult.No) return;
- string errMsg = "";
- this.slmBalanceInfo.InvoiceLightlyOrg(listOrder, "", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
- // this.QueryOrg();
- if (errMsg.Length > 0)
- {
- }
- else
- {
- removeUgr();
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- }
- }
- private void InvoiceGuom()
- {
- if (!this.IsCanBeInvoiced())
- return;
- ArrayList listOrder = GetUpdateCondition();
- if (listOrder.Count == 0)
- return;
- if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定编制结算单?") == DialogResult.No) return;
- string errMsg = "";
- // this.slmBalanceInfo.Invoice(listOrder,"", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- this.slmBalanceInfo.InvoiceLightlyGuoM(listOrder, "", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(),out errMsg);
- // this.QueryOrg();
- if (errMsg.Length > 0)
- {
- }
- else
- {
- removeUgr();
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- }
- }
- private DataSet GetSlmOrderLine(List<string> odpkList)
- {
- DataSet ds = new DataSet();
- if (odpkList.Count == 0)
- {
- return ds;
- }
- string sqlCondition = Core.StlMes.Client.Sale.Util.ConverObject
- .ConvertListStringValueToSqlCondition("ORD_PK", odpkList);
- string sql = @"select nvl(A.BALNCE_PRICE_STS, '0') BALNCE_PRICE_STS,
- nvl(A.BALNCE_PRICE_ORG_STS, '0') BALNCE_PRICE_ORG_STS,
- a.ord_pk,
- a.ord_ln_pk
- from slm_order_line a
- where 1=1 and validflag = '1' {0}";
- sql = string.Format(sql,sqlCondition);
- ds = base.ExecuteReader(sql);
- return ds;
- }
- private Hashtable GetOrderBalSts(List<string> odpkList)
- {
- Hashtable hs = new Hashtable();
- DataSet ds = GetSlmOrderLine(odpkList);
- try
- {
- string ordandlinePk = "";
- foreach (DataRow dr in ds.Tables[0].Rows)
- {
- ordandlinePk = dr["ORD_PK"].ToString() + dr["ORD_LN_PK"].ToString();
- if (!hs.ContainsKey(ordandlinePk))
- {
- hs.Add(ordandlinePk, new string[] { dr["BALNCE_PRICE_STS"].ToString(), dr["BALNCE_PRICE_ORG_STS"].ToString() });
- }
-
- }
- }
- catch
- {
- }
- return hs;
- }
- private void QueryUnAcceptTicket()
- {
- DataSet ds = null;
- ds = this.slmBalanceInfo.GetUnAcceptTicketAndTransAndOutStockTicket(this.dateTimePicker1.Value,
- this.dateTimePicker2.Value,cusInfo, suppunit);
- if (this.textBox7.Text.Length > 0)
- {
- ds = Core.StlMes.Client.Sale.Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch
- (ds, ASKPLAN_ID, this.textBox7.Text.Trim());
- }
- if (!this.UserInfo.GetUserName().Equals("admin"))
- ds = base.GetDataSetByFilterDeptId(ds);
- //if ("120504".Equals(suppunit))
- // ds = Util.UtilDataSet.GetDataSetWithRowFilter(ds, "supply_unit", suppunit);
- Core.StlMes.Client.Sale.Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsGridUnAccept, ds);
- Core.StlMes.Client.Sale.Util.UtilDataSet.GetDsByDescOrderFromSourceDataSet(dsGridUnAccept, "LISTNUMBER");
- }
- private void Query()
- {
-
- DataSet ds = null;
- DataSet dsTrans = null;
- // 只有编单界面才查
-
- if (this.radioButton1.Checked) // 已编卡
- {
- ds = this.slmBalanceInfo.GetUnAffrimSlmBalaneInfoByPlanBeginDateAndEndDate(this.dateTimePicker1.Value,
- this.dateTimePicker2.Value, suppunit);
- dsTrans = this.slmBalanceInfo.GetAcceptAndUnAffrimTransAndOutStockTicket(suppunit);
- }
- if (this.radioButton2.Checked)// 未编卡
- {
- ds = this.slmBalanceInfo.GetAffrimSlmBalaneInfoByPlanBeginDateAndEndDate(this.dateTimePicker1.Value,
- this.dateTimePicker2.Value, suppunit);
- dsTrans = this.slmBalanceInfo.GetAcceptAndAffrimTransAndOutStockTicket(suppunit);
- }
- if (this.textBox7.Text.Trim().Length > 0)
- {
- ds = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(ds, this.ASKPLAN_ID, this.textBox7.Text.Trim());
- dsTrans = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(dsTrans, this.ASKPLAN_ID, this.textBox7.Text.Trim());
- }
- if (this.textBox1.Text.Trim().Length > 0)
- {
- ds = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(ds, this.ORD_NO, this.textBox1.Text.Trim());
- }
- if (!this.UserInfo.GetUserName().Equals("admin"))
- ds = base.GetDataSetByFilterDeptId(ds);
- dsTrans = base.GetDataSetByFilterDeptId(dsTrans);
- //if ("120504".Equals(suppunit))
- // ds = Util.UtilDataSet.GetDataSetWithRowFilter(ds, "supply_unit", suppunit);
- //if ("120504".Equals(suppunit))
- // dsTrans = Util.UtilDataSet.GetDataSetWithRowFilter(dsTrans, "supply_unit", suppunit);
- this.dsBalanceMain.Clear();
- Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsBalanceMain,ds);
- SetTicketMoneyType(ref this.dsBalanceMain);
- SetOrd();
- try
- {
- dsTrans.Tables[0].TableName = this.dsBalanceMain.Tables[0].TableName;
- this.dsBalanceMain.Merge(dsTrans, false, System.Data.MissingSchemaAction.Ignore);
- }
- catch
- {
- }
- Core.StlMes.Client.Sale.Util.UtilDataSet.GetDsByDescOrderFromSourceDataSet(this.dsBalanceMain, this.ASKPLAN_ID);
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[this.BALNCE_PRICE_STS].CellActivation = Activation.ActivateOnly;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[this.BALNCE_PRICE_ORG_STS].CellActivation = Activation.ActivateOnly;
- CleanGrid();
- // this.SetMoney(ref this.dsBalanceMain);
- }
- private void SetTicketMoneyType(ref DataSet ds)
- {
- try
- {
- foreach (DataRow dr in ds.Tables[0].Rows)
- {
- dr["MONEY_TYPE"] = "货款";
- }
- }
- catch
- {
- }
- }
- private string ORD_PK = "ORD_PK";
- private string ORD_LN_PK = "ORD_LN_PK";
- private string BALNCE_PRICE_STS = "BALNCE_PRICE_STS";
- private string BALNCE_PRICE_ORG_STS = "BALNCE_PRICE_ORG_STS";
- private void SetOrd()
- {
- if (this.ultraGrid1.Rows.Count == 0)
- {
- return;
- }
- List<string> list = new List<string>();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (!list.Contains(ugr.Cells[this.ORD_PK].Value.ToString()))
- {
- list.Add(ugr.Cells[this.ORD_PK].Value.ToString());
- }
- }
- Hashtable hs = GetOrderBalSts(list);
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (hs.ContainsKey(ugr.Cells[this.ORD_PK].Value.ToString() + ugr.Cells[this.ORD_LN_PK].Value.ToString()))
- {
- string[] str = (string[])
- hs[ugr.Cells[this.ORD_PK].Value.ToString() + ugr.Cells[this.ORD_LN_PK].Value.ToString()];
- ugr.Cells[this.BALNCE_PRICE_STS].Value = str[0];
- ugr.Cells[this.BALNCE_PRICE_ORG_STS].Value = str[1];
- }
- // list.Add(ugr.Cells[this.ORD_PK].Value.ToString() + ugr.Cells[this.ORD_LN_PK].Value.ToString());
- }
- }
- private void QueryOrg()
- {
- DataSet ds = null;
- DataSet dsTrans = null;
-
- // 只有编单界面才查
- if (this.radioButton1.Checked)
- {
- ds = this.slmBalanceInfo.GetUnAffrimSlmBalaneInfoByPlanBeginDateAndEndDateOrg(this.dateTimePicker1.Value,
- this.dateTimePicker2.Value);
- dsTrans = this.slmBalanceInfo.GetAcceptAndUnAffrimTransAndOutStockTicketOrg();
- }
- if (this.radioButton2.Checked)
- {
- ds = this.slmBalanceInfo.GetAffrimSlmBalaneInfoByPlanBeginDateAndEndDateOrg(this.dateTimePicker1.Value,
- this.dateTimePicker2.Value);
- dsTrans = this.slmBalanceInfo.GetAcceptAndAffrimTransAndOutStockTicketOrg();
- }
- if (this.textBox7.Text.Trim().Length > 0)
- {
- ds = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(ds, this.ASKPLAN_ID, this.textBox7.Text.Trim());
- dsTrans = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(dsTrans, this.ASKPLAN_ID, this.textBox7.Text.Trim());
- }
- if (this.textBox1.Text.Trim().Length > 0)
- {
- ds = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(ds, this.ORD_NO, this.textBox1.Text.Trim());
- }
- // 按部门过滤数据
- // 按首次受票人过滤数据
- ds = Util.UtilDataSet.GetDataSetWithRowFilter(ds, "FST_DRAWEE_UNIT", GetFilterSaleOrg(suppunit));
- //if ("120504".Equals(suppunit))
- ds = Util.UtilDataSet.GetDataSetWithRowFilter(ds, "supply_unit", suppunit);
- if (!this.UserInfo.GetUserName().Equals("admin"))
- ds = base.GetDataSetByFilterDeptId(ds);
- dsTrans = base.GetDataSetByFilterDeptId(dsTrans);
- //if ("120504".Equals(suppunit))
- dsTrans = Util.UtilDataSet.GetDataSetWithRowFilter(dsTrans, "supply_unit", suppunit);
- this.dsBalanceMain.Clear();
- Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsBalanceMain, ds);
- SetTicketMoneyType(ref this.dsBalanceMain);
- try
- {
- dsTrans.Tables[0].TableName = this.dsBalanceMain.Tables[0].TableName;
- this.dsBalanceMain.Merge(dsTrans, false, System.Data.MissingSchemaAction.Ignore);
- }
- catch
- {
- }
- SetOrd();
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[this.BALNCE_PRICE_STS].CellActivation = Activation.ActivateOnly;
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[this.BALNCE_PRICE_ORG_STS].CellActivation = Activation.ActivateOnly;
- CleanGrid();
- // this.SetMoney(ref this.dsBalanceMain);
- }
- private string[] GetFilterSaleOrg(String flag)
- {
- if (flag == "120504")
- return new string[] { "120603", "120604", "120605", "120608" };
- else
- return new string[] { "120603", "120604", "120605" };
- }
- private void CleanGrid()
- {
- this.dsGridThree.Clear();
- this.dsGridFour.Clear();
-
- }
- private void Affrim()
- {
- ArrayList listOrder = GetUpdateCondition();
- if (listOrder.Count == 0)
- return;
- string errMsg = "";
- this.slmBalanceInfo.Affrim(listOrder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
- if (errMsg.Length > 0)
- {
- }
- else
- {
- removeUgr();
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- }
-
- }
- private void removeUgr()
- {
- try
- {
- System.Collections.Generic.List<Infragistics.Win.UltraWinGrid.UltraGridRow> listugr
- = new List<UltraGridRow>();
- if(this.ultraGrid1.ActiveRow != null)
- this.ultraGrid1.ActiveRow.Selected = true;
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
- {
- listugr.Add(ugr);
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in listugr)
- {
- ugr.Delete();
- }
- this.ultraGrid1.UpdateData();
- }
- catch { }
- }
- private void AffrimOrg()
- {
- ArrayList listOrder = GetUpdateCondition();
- if (listOrder.Count == 0)
- return;
- string errMsg = "";
- this.slmBalanceInfo.AffrimOrg(listOrder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(),out errMsg);
- // this.QueryOrg();
- if (errMsg.Length > 0)
- {
- }
- else
- {
- removeUgr();
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- }
- }
- private void UnAffrim()
- {
- ArrayList listOrder = GetUpdateCondition();
- if (listOrder.Count == 0)
- return;
- string errMsg = "";
- if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定取消选定行?") == DialogResult.No) return;
- this.slmBalanceInfo.UnAffrim(listOrder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(),out errMsg);
- // this.Query();
- if (errMsg.Length > 0)
- {
- }
- else
- {
- removeUgr();
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- }
- }
- private void UnAffrimOrg()
- {
- ArrayList listOrder = GetUpdateCondition();
- if (listOrder.Count == 0)
- return;
- if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定取消选定行?") == DialogResult.No) return;
- string errMsg = "";
- this.slmBalanceInfo.UnAffrimOrg(listOrder, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(),out errMsg);
- // this.QueryOrg();
- if (errMsg.Length > 0)
- {
- }
- else
- {
- removeUgr();
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- }
- }
- private int saveDigit = 4;
- private void SetMoney(ref DataSet ds)
- {
-
- if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
- return;
- foreach (DataRow dr in ds.Tables[0].Rows)
- {
- dr[this.MONEY] = Math.Round(Util.ConverObject.ConvertToDouble(dr[this.WEIGHT].ToString())
- * Util.ConverObject.ConvertToDouble(dr[this.PRICE].ToString()), saveDigit);
- }
- }
- private Boolean IsCanBeUpdateWithDifferentPerson(string user)
- {
- if (user == CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName())
- {
- return true;
- }
- else
- {
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowError("只允许操作本人数据");
- return false;
- }
- }
- private void Invoice()
- {
- if (!IsCanBeInvoiced())
- return;
- ArrayList listOrder = GetUpdateCondition();
- if (listOrder.Count == 0)
- return;
- if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定编制结算单?") == DialogResult.No) return;
- string errMsg = "";
- // this.slmBalanceInfo.Invoice(listOrder,"", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- this.slmBalanceInfo.InvoiceLightly(listOrder, "", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg);
- if (errMsg.Length > 0)
- {
- }
- else
- {
- removeUgr();
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- }
-
- // this.Query();
- }
- private void RollBackAskPlanId()
- {
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- return;
- this.slmBalanceInfo.RollBaskAskPlanId(ugr.Cells[this.ASKPLAN_ID].Value.ToString(),
- CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- }
- private Boolean IsCanBeInvoiced()
- {
- // 钢贸是否必须要在首次结算后再进行末次编单
- Boolean isAllowInvoice = true;
- if (this.ultraGrid1.Rows.Count == 0)
- return false;
- if (this.ultraGrid1.Rows.Count == 1)
- this.ultraGrid1.Rows[0].Selected = true;
- this.ultraGrid1.ActiveRow.Selected = true;
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
- {
- //if (Util.ConverObject.ConvertToDouble(ugr.Cells["PRICE"].Value.ToString()) == 0
- // && ugr.Cells["MONEY_TYPE"].Value.ToString() == "货款"
- // )
- //{
- // Util.MessageUtil.ShowError("记录中有单价为0记录,不允许编单");
- // return false;
- //}
- string FST_DRAWEE_UNIT = ugr.Cells["FST_DRAWEE_UNIT"].Value.ToString();
- // 钢贸的首次结算必须要等首次开票完成
- if (( FST_DRAWEE_UNIT =="120604"|| FST_DRAWEE_UNIT =="120605") && isAllowInvoice && ugr.Cells["FORECORPCODE"].Value.ToString() == "钢贸公司" && ugr.Cells["BALANCESTATUS_ORG"].Value.ToString()+"" != "3")
- {
- if (ugr.Cells["MONEY_TYPE"].Value.ToString() == "货款")
- {
- Util.MessageUtil.ShowError("记录中有未进行首次编单记录,不允许编单");
- return false;
- }
- }
- if ( ugr.Cells["MONEY_TYPE"].Value.ToString() == "货款" && !IsCanBeUpdateWithDifferentPerson(ugr.Cells["AFFRIMPERSON"].Value.ToString()))
- {
- return false;
- }
- }
- return true;
- }
- private Boolean IsCanBeInvoicedOrg()
- {
- if (this.ultraGrid1.Rows.Count == 0)
- return false;
- if (this.ultraGrid1.Rows.Count == 1)
- this.ultraGrid1.Rows[0].Selected = true;
- this.ultraGrid1.ActiveRow.Selected = true;
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
- {
- if (Util.ConverObject.ConvertToDouble(ugr.Cells["PRICE_ORG"].Value.ToString()) == 0 && ugr.Cells["MONEY_TYPE"].Value.ToString() == "货款")
- {
- Util.MessageUtil.ShowError("记录中有单价为0记录,不允许编单");
- return false;
- }
- if (ugr.Cells["MONEY_TYPE"].Value.ToString() == "货款" && !IsCanBeUpdateWithDifferentPerson(ugr.Cells["AFFRIMPERSON_ORG"].Value.ToString()))
- {
- return false;
- }
- }
- return true;
- }
- private ArrayList GetUpdateCondition()
- {
- ArrayList list = new ArrayList();
- if (this.ultraGrid1.Rows.Count == 0)
- return list;
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- return list;
- if (this.ultraGrid1.Selected.Rows.Count == 0)
- {
- CheckedIsGridGroupRow(ugr, ref list);
- }
- else
- {
- for (int i = 0; i < this.ultraGrid1.Selected.Rows.Count; i++)
- {
-
- CheckedIsGridGroupRow(this.ultraGrid1.Selected.Rows[i], ref list);
- }
- }
- return list;
- }
- private ArrayList GetUpdateConditionSaleOrg()
- {
- ArrayList list = new ArrayList();
- if (this.ultraGrid1.Rows.Count == 0)
- return list;
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- return list;
- if (this.ultraGrid1.Selected.Rows.Count == 0)
- {
- CheckedIsGridGroupRowSaleOrg(ugr, ref list);
- }
- else
- {
- for (int i = 0; i < this.ultraGrid1.Selected.Rows.Count; i++)
- {
- CheckedIsGridGroupRowSaleOrg(this.ultraGrid1.Selected.Rows[i], ref list);
- }
- }
- return list;
- }
- private void CheckedIsGridGroupRow(UltraGridRow ugr, ref ArrayList ar1)
- {
- if (ugr is UltraGridGroupByRow)
- {
- for (int i = 0; i < ugr.ChildBands[0].Rows.Count; i++)
- {
- CheckedIsGridGroupRow(ugr.ChildBands[0].Rows[i], ref ar1);
- }
- }
- else
- {
-
- ar1.Add(new string[]{
- ugr.Cells[this.ORD_NO].Value.ToString(),
- ugr.Cells[this.ORD_SEQ].Value.ToString(),
- ugr.Cells[this.ORD_LN_DLY].Value.ToString(),
- ugr.Cells[this.ASKPLAN_ID].Value.ToString(),
- ugr.Cells[this.ASKPLAN_ID_SEQ].Value.ToString(),
- ugr.Cells[this.SPETKEY].Value.ToString(),
- ugr.Cells[this.STEELCODEKEY].Value.ToString(),
- ugr.Cells[this.BUYERCODE].Value.ToString(),
- ugr.Cells[this.PRICE].Value.ToString(),
- ugr.Cells[this.BALANCESTATUS].Value.ToString(),
- ugr.Cells["ORD_PK"].Value.ToString(),
- ugr.Cells["ORD_LN_PK"].Value.ToString(),
- ugr.Cells["ORD_LN_DLY_PK"].Value.ToString(),
- ugr.Cells["BALANCESTATUS_ORG"].Value.ToString(),
- ugr.Cells["CUSTOMER_NO"].Value.ToString(),
- ugr.Cells["SALE_AREA_NO"].Value.ToString(),
- ugr.Cells["FST_DRAWEE_UNIT"].Value.ToString(),
- ugr.Cells["FORECORPCODE"].Value.ToString(),
- ugr.Cells["LISTNUMBER"].Value.ToString(),
- ugr.Cells["MONEY_TYPE"].Value.ToString()
- });
-
- }
- }
- private void CheckedIsGridGroupRowSaleOrg(UltraGridRow ugr, ref ArrayList ar1)
- {
- if (ugr is UltraGridGroupByRow)
- {
- for (int i = 0; i < ugr.ChildBands[0].Rows.Count; i++)
- {
- CheckedIsGridGroupRowSaleOrg(ugr.ChildBands[0].Rows[i], ref ar1);
- }
- }
- else
- {
-
- ar1.Add(new string[]{
- ugr.Cells[this.ORD_NO].Value.ToString(),
- ugr.Cells[this.ORD_SEQ].Value.ToString(),
- ugr.Cells[this.ORD_LN_DLY].Value.ToString(),
- ugr.Cells[this.ASKPLAN_ID].Value.ToString(),
- ugr.Cells[this.ASKPLAN_ID_SEQ].Value.ToString(),
- ugr.Cells[this.SPETKEY].Value.ToString(),
- ugr.Cells[this.STEELCODEKEY].Value.ToString(),
- ugr.Cells[this.BUYERCODE].Value.ToString(),
- ugr.Cells["PRICE_ORG"].Value.ToString(),
- ugr.Cells[this.BALANCESTATUS].Value.ToString(),
- ugr.Cells["ORD_PK"].Value.ToString(),
- ugr.Cells["ORD_LN_PK"].Value.ToString(),
- ugr.Cells["ORD_LN_DLY_PK"].Value.ToString(),
- ugr.Cells["BALANCESTATUS_ORG"].Value.ToString(),
- ugr.Cells["CUSTOMER_NO"].Value.ToString(),
- ugr.Cells["SALE_AREA_NO"].Value.ToString(),
- ugr.Cells["FST_DRAWEE_UNIT"].Value.ToString(),
- ugr.Cells["FORECORPCODE"].Value.ToString(),
- ugr.Cells["LISTNUMBER"].Value.ToString(),
- ugr.Cells["MONEY_TYPE"].Value.ToString()
- });
-
- }
- }
-
- private void UpdatePrice()
- {
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- double price = Convert.ToDouble(this.ultraNumericEditor1.Value);
- string reason = this.textBox2.Text.Trim();
- if (reason.Length == 0)
- {
- MessageBox.Show("请输入调整原因");
- return;
- }
- if (price == 0)
- return;
- string errMsg = "";
- string orderno = ugr.Cells[this.ORD_NO].Value.ToString();
- string ord_seq = ugr.Cells[this.ORD_SEQ].Value.ToString();
- string ord_ln = ugr.Cells[this.ORD_LN_DLY].Value.ToString();
- string askplanId = ugr.Cells[this.ASKPLAN_ID].Value.ToString();
- string askPlanIdSeq = ugr.Cells[this.ASKPLAN_ID_SEQ].Value.ToString();
- string spetKey = ugr.Cells[this.SPETKEY].Value.ToString();
- string steelcodekey = ugr.Cells[this.STEELCODEKEY].Value.ToString();
- string person = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- this.slmBalanceInfo.UpdatePrice(orderno, ord_seq, ord_ln, askplanId, askPlanIdSeq, spetKey, steelcodekey,
- price, reason, person, out errMsg);
- if (errMsg.Length == 0)
- {
- MessageBox.Show("修改成功");
- ugr.Cells[this.PRICE].Value = Math.Round(price,this.saveDigit);
- ugr.Cells[this.MONEY].Value = Math.Round(Convert.ToDouble(ugr.Cells[this.WEIGHT].Value) * price, this.saveDigit);
- ugr.Cells[this.ADJUSTPRICEREASON].Value = reason;
- }
-
- }
- private string[] GetGridThreeDataStruct()
- {
- return new string[]
- {
- "ASKPLAN_ID",
- "TALLYSHEET_NO",
- // "ORD_LN_DLY",
- "BATCH_NO",
- "QUANTITY",
- "ACT_WGT"
- };
- }
- /// <summary>
- /// 价格由专门的人员维护,结算人员只需要进行编单
- /// 但是也提供价格调整功能,只是调整原因必须输入,见UpdatePrice
- /// </summary>
- private void InputPrice()
- {
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- double price = Convert.ToDouble(this.ultraNumericEditor1.Value);
- string reason = this.textBox2.Text.Trim();
- if (price == 0)
- return;
- string errMsg = "";
- string orderno = ugr.Cells[this.ORD_NO].Value.ToString();
- string ord_seq = ugr.Cells[this.ORD_SEQ].Value.ToString();
- string ord_ln = ugr.Cells[this.ORD_LN_DLY].Value.ToString();
- string askplanId = ugr.Cells[this.ASKPLAN_ID].Value.ToString();
- string askPlanIdSeq = ugr.Cells[this.ASKPLAN_ID_SEQ].Value.ToString();
- string spetKey = ugr.Cells[this.SPETKEY].Value.ToString();
- string steelcodekey = ugr.Cells[this.STEELCODEKEY].Value.ToString();
- string person = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- this.slmBalanceInfo.inputPrice(orderno, ord_seq, ord_ln, askplanId, askPlanIdSeq, spetKey, steelcodekey,
- price, person, out errMsg);
- if (errMsg.Length == 0)
- {
- MessageBox.Show("修改成功");
- ugr.Cells[this.PRICE].Value = Math.Round(price, this.saveDigit);
- ugr.Cells[this.MONEY].Value = Math.Round(Convert.ToDouble(ugr.Cells[this.WEIGHT].Value) * price, this.saveDigit);
- ugr.Cells[this.ADJUSTPRICEREASON].Value = reason;
- }
- }
-
- private string[] GetGrid1DataStruct()
- {
- return GetBalanceMainColumn();
- }
- private string[] GetUnAcceptBalaceColumn()
- {
- return new string[]
- {
- "LISTNUMBER",
- "ASKPLAN_ID",
- "SEND_NUM",
- // "ORDER_UNIT",
- "QUANTITY",
- "WEIGHT",
- "MONEY",
- "OUTWEIGHT",
- "OUTSTOCKMNY",
- "TRANSMONEY",
- "TRANS_TYPE_NAME",
- "SALE_AREA_DESC",
- "BUYERNAME",
- "INCEPTCORPCODE",
- "SUPPLY_UNIT_DESC"
- };
- }
- private string[] GetBalanceMainColumn()
- {
- return new string[]
- {
- "ASKPLAN_ID",
- LISTNUMBER,
- "MONEY_TYPE",
- "SALE_AREA_DESC",
- "FORECORPCODE",
- "BUYERCODE",
- "BUYERNAME",
- "SUPPLY_UNIT_DESC",
- "FST_DRAWEE_UNIT",
- "ORD_NO",
- "ORD_SEQ",
- "ORD_LN_DLY",
- "ASKPLAN_ID_SEQ",
- "STEELCODEKEY",
- "PACTINDEX",
- "SPETKEY",
- "SEND_NUM",
- "ORDER_UNIT",
- "QUANTITY",
- "WEIGHT",
- "BALNCE_PRICE_STS",
- "BALNCE_PRICE_ORG_STS",
- "PRICE",
- "MONEY",
- "PRICE_ORG",
- "MONEY_ORG",
- "CONTAIN_TAX",
- "CATEGORY",
- "SPEC_ABBSYMNAME",
- "STD_STYLE_DESC",
- "MODEL_DESC",
- "TRANS_TYPE_NAME",
- "ADJUSTPRICEPERSON",
- "ADJUSTPRICEREASON",
- "BASEPRICE",
- "INCEPTCORPCODE",
- // "STATIONCODE",
- "BALANCESTATUS_ORG",
- "AFFRIMPERSON_ORG",
- "AFFIRMTIME_ORG",
- "BALANCESTATUS",
- "AFFRIMPERSON",
- "AFFIRMTIME",
- // "AREACODE",
- // "DOCKCODE",
- // "SHIPNO",
- // "FIXSIZE",
-
-
- "INVOICENO_ORG",
- "REALINVOICENO_ORG",
- "ORD_PK",
- "ORD_LN_PK",
- "ORD_LN_DLY_PK",
- "CUSTOMER_NO",
- "CUSTOMER_NM",
- "SALE_AREA_NO"
-
-
- };
- }
- private string BUYERCODE = "BUYERCODE";
- private string ORD_NO = "ORD_NO";
- private string ORD_SEQ = "ORD_SEQ";
- private string ORD_LN_DLY = "ORD_LN_DLY";
- private string ASKPLAN_ID = "ASKPLAN_ID";
- private string ASKPLAN_ID_SEQ = "ASKPLAN_ID_SEQ";
- private string SPETKEY = "SPETKEY";
- private string STEELCODEKEY = "STEELCODEKEY";
- private string MONEY = "MONEY";
- private string WEIGHT = "WEIGHT";
- private string PRICE = "PRICE";
- private string BALANCESTATUS = "BALANCESTATUS";
- private string ADJUSTPRICEREASON = "ADJUSTPRICEREASON";
- private string BALANCESTATUS_INIT = "0";
- private string BALANCESTATUS_AFFRIM = "2";
- private string BALANCESTATUS_INVOINCE = "3";
- private string[] GetGrid2DataStruct()
- {
- return new string[]
- {
- "ORDERNO",
- "PLY",
- "WIDTH",
- "LENGTH",
- "STEELCODE",
- "WEIGHT",
- "QUANTITY",
- "BASEPRICE",
- "PRICE",
- "MONEY",
- "HOISTINGFEE",
- "CARFMONEY",
- "SHIPPRICE",
- "TRANSMONEYQC",
- "TRANSMONEYSY1",
- "TRANSMONETRAIN"
- }
- ;
- }
-
- private Hashtable GetColumnAndCaption()
- {
- Hashtable hs = new Hashtable();
- hs.Add("SHIPNO", "船号");
- hs.Add("WEIGHT", "重量");
- hs.Add("DOCKCODE", "港口");
- hs.Add("TRANSMONEYSY1", "船运费");
- hs.Add("SHIPPRICE", "船运价");
- hs.Add("PLY", "厚/直径/壁厚");
- hs.Add("WIDTH", "宽/外径");
- hs.Add("HOISTINGFEE", "吊装费");
- hs.Add("TRANSMONETRAIN", "火运费");
- hs.Add("ORD_NO", "合同号");
- hs.Add("ORD_SEQ", "合同行");
- hs.Add("ORD_LN_DLY", "交货行");
- hs.Add("ASKPLAN_ID", "提单号");
- hs.Add("ASKPLAN_ID_SEQ", "提单序号");
- hs.Add("SPETKEY", "规格");
- hs.Add("STEELCODEKEY", " 钢级(牌号)");
- hs.Add("ADJUSTPRICEPERSON", "调价人");
- hs.Add("ADJUSTPRICEREASON", "调价原因");
- hs.Add("AFFRIMPERSON", "末次确认人");
- hs.Add("AFFIRMTIME", "末次确认时间");
- hs.Add("AFFRIMPERSON_ORG", "首次确认人");
- hs.Add("AFFIRMTIME_ORG", "首次确认时间");
- hs.Add("BASEPRICE", "订单价");
- hs.Add("FORECORPCODE", "子公司");
- hs.Add("STATIONCODE", "到站");
- hs.Add("BUYERNAME", "结算单位名称");
- hs.Add("BUYERCODE", "客户编码");
- hs.Add("CUSTOMER_NM", "订货单位");
- hs.Add("TRANS_TYPE_NAME", "运输方式");
- hs.Add("MONEY_ORG", "首次结算金额");
- hs.Add("PRICE_ORG", "首次结算价");
- hs.Add("CATEGORY", "品名");
- hs.Add("SPEC_ABBSYMNAME", "标准");
- hs.Add("STD_STYLE_DESC", "标准类别");
- hs.Add("MODEL_DESC", "扣型");
- hs.Add("ORDER_UNIT", "计量单位");
- hs.Add("SALE_AREA_DESC", "销售区域");
- hs.Add("SEND_NUM", "实发量");
- hs.Add("CONTAIN_TAX", "是否含税");
- hs.Add("BALANCESTATUS_ORG", "首次结算状态");
- hs.Add("FST_DRAWEE_UNIT", "首次受票人");
- hs.Add("INVOICENO_ORG", "首次结算单号");
- hs.Add("REALINVOICENO_ORG", "首次真实单号");
- hs.Add("BALNCE_PRICE_STS", "末次价格有效性");
- hs.Add("BALNCE_PRICE_ORG_STS", "首次价格有效性");
- hs.Add("PACTINDEX", "钢种");
- hs.Add("OUTWEIGHT", "出库费(重量)");
- hs.Add("OUTSTOCKMNY", "出库费(金额)");
- hs.Add("MONEY_TYPE", "类型");
- hs.Add("SUPPLY_UNIT_DESC", "制造商");
- return hs;
-
- }
- protected override List<string> GetGridColumnListHidden()
- {
- List<string> list = new List<string>();
- list.Add(this.ASKPLAN_ID_SEQ);
- list.Add(this.BALANCESTATUS);
- return list;
-
- }
- private void SetGridShowLength()
- {
- Hashtable hs = StaticData.TbColumnAndCaption.GetDataSetColumnLength();
- try
- {
- foreach (string s in hs.Keys)
- {
- try
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[s].Width =
- (int) Util.ConverObject.ConvertToDouble(hs[s]);
- }
- catch
- { }
- try
- {
- // this.ultraGrid2.DisplayLayout.Bands[0].Columns[s].Width = (int)Util.ConverObject.ConvertToDouble(hs[s]);
- }
- catch
- { }
- try
- {
- this.ultraGrid3.DisplayLayout.Bands[0].Columns[s].Width = (int)Util.ConverObject.ConvertToDouble(hs[s]);
- }
- catch
- { }
- }
- }
- catch
- { }
- }
- private string[] GetGridFiveDataStruct()
- {
- return new string[]
- {
- "TICKETTYPE",
- "MONEY",
- // "TICKETNUM",
- "MONEY_TYPE",
- "TRANS_TYPE",
- // "MOTORMANNAME",
- "REG_ID",
- "REG_DTIME",
- "AFFRIM_ID",
- "AFFRIM_TIME",
- "STATUS_CD"
- };
- }
- protected override Hashtable GetGridColumnLength()
- {
- return StaticData.TbColumnAndCaption.GetDataSetColumnLength();
- }
- private void QueryGridThree()
- {
- this.dsGridThree.Clear();
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- ugr = this.ultraGrid1.Rows[0];
-
- string orderno = ugr.Cells[this.ORD_NO].Value.ToString();
- string orderseq = ugr.Cells[this.ORD_SEQ].Value.ToString();
- string orderlineseq = ugr.Cells[this.ORD_LN_DLY].Value.ToString();
- string askplanid = ugr.Cells[this.ASKPLAN_ID].Value.ToString();
- string askplanidseq = ugr.Cells[this.ASKPLAN_ID_SEQ].Value.ToString();
- string spetkey = ugr.Cells[this.SPETKEY].Value.ToString();
- string steelkey = ugr.Cells[this.STEELCODEKEY].Value.ToString();
-
- DataSet dsDetail =
- this.slmBalanceInfo.GetSlmBalanceDetailAllGroupByBatchNo(
- orderno, orderseq, orderlineseq, askplanid, askplanidseq, spetkey, steelkey);
- Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsGridThree, dsDetail);
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- QueryGridThree();
- QueryGridFive();
- QueryGridFour();
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- if (this.ultraGrid1.Rows.Count == 1)
- ugr = this.ultraGrid1.Rows[0];
- else
- ugr = this.ultraGrid1.ActiveRow;
- double price = Util.ConverObject.ConvertToDouble(ugr.Cells[this.PRICE].Value);
- string adjustReason = ugr.Cells[this.ADJUSTPRICEREASON].Value.ToString();
- this.ultraNumericEditor1.Value = price;
- this.textBox2.Text = adjustReason;
- }
-
- private void FrmBalanceTicketMgt_Shown(object sender, EventArgs e)
- {
-
- HiddenToolbars();
- if (!(base.GetSaleOrgDesc() == "国贸公司"))
- {
- string[] keys = new string[] { "QueryOrg", "AffrimOrg", "UnAffrimOrg",
- "InvoiceOrg","SetPriceOrg","ExportPrice","Export","AcpRllRecord"};
- try
- {
- foreach (string s in keys)
- {
- toolMenu.Toolbars[0].Tools[s].SharedProps.Visible = true;
- }
- }
- catch
- { }
- try
- {
- if (cusInfo == "2")
- {
- toolMenu.Toolbars[0].Tools["Accept"].SharedProps.Visible = true;
- toolMenu.Toolbars[0].Tools["QueryUnAcept"].SharedProps.Visible = true;
- // toolMenu.Toolbars[0].Tools["UnAccept"].SharedProps.Visible = true;
- }
- else
- {
- toolMenu.Toolbars[0].Tools["Accept"].SharedProps.Visible = false;
- toolMenu.Toolbars[0].Tools["QueryUnAcept"].SharedProps.Visible = false;
- // toolMenu.Toolbars[0].Tools["UnAccept"].SharedProps.Visible = false;
- }
- }
- catch
- {
- }
- }
- }
- private void ultraGrid1_AfterRowActivate_1(object sender, EventArgs e)
- {
- QueryGridThree();
- QueryGridFive();
- QueryGridFour();
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- if (this.ultraGrid1.Rows.Count == 1)
- ugr = this.ultraGrid1.Rows[0];
- else
- ugr = this.ultraGrid1.ActiveRow;
- double price = Util.ConverObject.ConvertToDouble(ugr.Cells[this.PRICE].Value);
- string adjustReason = ugr.Cells[this.ADJUSTPRICEREASON].Value.ToString();
- this.ultraNumericEditor1.Value = price;
- this.textBox2.Text = adjustReason;
- }
- private void groupBox1_Enter(object sender, EventArgs e)
- {
- }
- private void textBox7_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == 13)
- {
- if (cusInfo == "2")
- this.Query();
- else
- this.QueryOrg();
- }
- }
- private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == 13)
- {
- if (cusInfo == "2")
- this.Query();
- else
- this.QueryOrg();
- }
- }
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- if (cusInfo == "2")
- this.Query();
- else
- this.QueryOrg();
- }
- private void radioButton2_CheckedChanged(object sender, EventArgs e)
- {
- if (cusInfo == "2")
- this.Query();
- else
- this.QueryOrg();
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
-
- }
- private void SetToolBars()
- {
- string[] keys = new string[] { "QueryOrg", "AffrimOrg", "UnAffrimOrg",
- "InvoiceOrg","SetPriceOrg","ExportPrice","Export"};
- if (ultraTabControl1.SelectedTab.Index == 0)
- {
- this.textBox1.ReadOnly = true;
- this.radioButton1.Visible = false;
- this.radioButton2.Visible = false;
- try
- {
- toolMenu.Toolbars[0].Tools["Accept"].SharedProps.Visible = true;
- toolMenu.Toolbars[0].Tools["QueryUnAcept"].SharedProps.Visible = true;
- // toolMenu.Toolbars[0].Tools["UnAccept"].SharedProps.Visible = false;
- }
- catch
- {
- }
-
- foreach (string s in keys)
- {
- try
- {
- toolMenu.Toolbars[0].Tools[s].SharedProps.Visible = false;
- }
- catch
- {
- }
- }
- }
- if (ultraTabControl1.SelectedTab.Index == 1)
- {
- this.textBox1.ReadOnly = false;
- this.radioButton1.Visible = true;
- this.radioButton2.Visible = true;
- try
- {
-
- toolMenu.Toolbars[0].Tools["Accept"].SharedProps.Visible = false;
- toolMenu.Toolbars[0].Tools["QueryUnAcept"].SharedProps.Visible = false;
- // toolMenu.Toolbars[0].Tools["UnAccept"].SharedProps.Visible = true;
-
-
- }
- catch
- {
- }
-
- foreach (string s in keys)
- {
- try
- {
- toolMenu.Toolbars[0].Tools[s].SharedProps.Visible = true;
- }
- catch
- {
- }
- }
- }
-
- }
-
- private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (cusInfo == "2")
- {
- if (ultraTabControl1.SelectedTab.Index == 0)
- {
- this.textBox1.ReadOnly = true;
- this.radioButton1.Visible = false;
- this.radioButton2.Visible = false;
- try
- {
- toolMenu.Toolbars[0].Tools["Accept"].SharedProps.Visible = true;
- toolMenu.Toolbars[0].Tools["QueryUnAcept"].SharedProps.Visible = true;
- // toolMenu.Toolbars[0].Tools["UnAccept"].SharedProps.Visible = false;
- toolMenu.Toolbars[0].Tools["Affrim"].SharedProps.Visible = false;
- toolMenu.Toolbars[0].Tools["UnAffrim"].SharedProps.Visible = false;
- toolMenu.Toolbars[0].Tools["Invoice"].SharedProps.Visible = false;
- toolMenu.Toolbars[0].Tools["SetPrice"].SharedProps.Visible = false;
- // toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = false;
- toolMenu.Toolbars[0].Tools["Query"].SharedProps.Visible = false;
- }
- catch
- { }
- }
- else
- {
- try
- {
- this.textBox1.ReadOnly = false;
- this.radioButton1.Visible = true;
- this.radioButton2.Visible = true;
- toolMenu.Toolbars[0].Tools["Accept"].SharedProps.Visible = false;
- toolMenu.Toolbars[0].Tools["QueryUnAcept"].SharedProps.Visible = false;
- toolMenu.Toolbars[0].Tools["Affrim"].SharedProps.Visible = true;
- toolMenu.Toolbars[0].Tools["UnAffrim"].SharedProps.Visible = true;
- toolMenu.Toolbars[0].Tools["Invoice"].SharedProps.Visible = true;
- toolMenu.Toolbars[0].Tools["SetPrice"].SharedProps.Visible = true;
- toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = true;
- // toolMenu.Toolbars[0].Tools["UnAccept"].SharedProps.Visible = true;
- try
- {
- toolMenu.Toolbars[0].Tools["Query"].SharedProps.Visible = true;
- }
- catch
- { }
- try
- {
- toolMenu.Toolbars[0].Tools["AcpRllRecord"].SharedProps.Visible = true;
- }
- catch
- { }
-
- }
- catch
- { }
- }
- }
- else if (cusInfo == "3")
- SetToolBars();
- }
- private void ultraGrid1_AfterRowActivate_2(object sender, EventArgs e)
- {
- QueryGridThree();
- // QueryGridFive();
- // QueryGridFour();
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null;
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- if (this.ultraGrid1.Rows.Count == 1)
- ugr = this.ultraGrid1.Rows[0];
- else
- ugr = this.ultraGrid1.ActiveRow;
- double price = Util.ConverObject.ConvertToDouble(ugr.Cells[this.PRICE].Value);
- string adjustReason = ugr.Cells[this.ADJUSTPRICEREASON].Value.ToString();
- this.ultraNumericEditor1.Value = price;
- this.textBox2.Text = adjustReason;
- }
-
- }
- }
|