/// <summary> /// Search the OrderedDictionary index OD_MyInventory by Name string to return the SLMIV Folder or Item object. /// </summary> /// <param name="text_title">name string of inventory folder or item</param> /// <param name="invtype">INV_TYPE of the object found</param> /// <returns>Returns a FOLDER or ITEM object from inventory and item's INV_TYPE</returns> public static Object GetMyInventoryObjectByText(string text_title, out INV_TYPE invtype) { Object objectfound = new Object(); INV_TYPE temp = INV_TYPE.NULL; foreach (KeyValuePair <int, Object> pair in OD_MyInventory) { if (pair.Value.GetType().ToString() == "MyInventory.Folder") { temp = INV_TYPE.FOLDER; Folder ftemp = (Folder)pair.Value; if (ftemp.name == text_title) { objectfound = pair.Value; break; } } else { temp = INV_TYPE.ITEM; Item Itemp = (Item)pair.Value; if (Itemp.name == text_title) { objectfound = pair.Value; break; } } } invtype = temp; return(objectfound); }
public QueryPrintEntity() { this.m_bPrint = false; this.m_bShowDialog = false; this.m_invType = INV_TYPE.INV_SPECIAL; this.m_nYear = 0; this.m_nMonth = 0; this.m_nTaxPeriod = 0; this.m_itemAction = ITEM_ACTION.ITEM_TOTAL; this.m_strTitle = ""; this.m_strSubItem = ""; this.m_strItemDetail = ""; this.m_bIsLocked = false; }
public string[] CreateMonthlyHead(int nYear, int nMonth, int nPeriod, INV_TYPE InvType) { string[] strArray = new string[0]; List <string> list = new List <string>(); try { TaxStatisData data = this.taxCard.GetMonthStatistics(nYear, nMonth, nPeriod); if (data == null) { return(null); } for (int i = 0; i < data.get_Count(); i++) { InvAmountTaxStati stati = data.get_Item(i); if (stati == null) { return(null); } if ((stati.get_InvTypeStr().Length > 0) && (stati.get_InvTypeStr().Trim() == InvTypeEntity.GetInvName(InvType))) { list.Add(stati.PeriodEarlyStockNum.ToString()); list.Add(stati.BuyNum.ToString()); list.Add(stati.ReturnInvNum.ToString()); list.Add(stati.PlusInvoiceNum.ToString()); list.Add(stati.PlusInvWasteNum.ToString()); list.Add(stati.PeriodEndStockNum.ToString()); list.Add(stati.NegativeInvoiceNum.ToString()); list.Add(stati.NegativeInvWasteNum.ToString()); if (this.bIsMainMachine && this.bHasChild) { list.Add(stati.AllotInvNum.ToString()); list.Add(stati.ReclaimStockNum.ToString()); } } } strArray = list.ToArray(); } catch (Exception exception) { this.loger.Info(exception.Message); ExceptionHandler.HandleError(exception); } return(strArray); }
public static string GetInvName(INV_TYPE inv_TYPE_0) { switch (inv_TYPE_0) { case INV_TYPE.INV_SPECIAL: return("专用发票"); case INV_TYPE.INV_COMMON: return("普通发票"); case INV_TYPE.INV_TRANSPORTATION: return("货物运输业增值税专用发票"); case INV_TYPE.INV_VEHICLESALES: return("机动车销售统一发票"); } return("废旧物资发票"); }
/// <summary> /// Write and Element to the XmlTextWriter from the treenodecollection /// </summary> /// <param name="xmltwriter">XmlTextWriter</param> /// <param name="treenodecoll">TreeNodeCollection</param> public static void TreeViewXMLWriteRecursive(XmlTextWriter xmltwriter, TreeNodeCollection treenodecoll) { INV_TYPE itype = INV_TYPE.NULL; foreach (TreeNode tn0 in treenodecoll) { xmltwriter.WriteStartElement(Convert.ToString(tn0.Tag)); xmltwriter.WriteAttributeString("name", tn0.Text); xmltwriter.WriteAttributeString("uuid", tn0.Name); ImageWriteAttributeString(xmltwriter, tn0); //xmlWriter.WriteValue(Utils.MIUtils.GetMyInventoryObjectByText(tn0.Text, out itype).ToString()); xmltwriter.WriteValue(Utils.MIUtils.GetInvObj(tn0.Name, MIUtils.OD_treeindex, out itype).ToString()); if (tn0.Nodes.Count > 0) { TreeViewXMLWriteRecursive(xmltwriter, tn0.Nodes); } } }
/// <summary> /// Search the OrderedDictionary index OD_MyInventory by index number to return the SLMIV Folder or Item object. /// </summary> /// <param name="index">index of the object in OD_MyInventory</param> /// <param name="invtype">INV_TYPE of the object found</param> /// <returns>Returns a FOLDER or ITEM object from inventory and item's INV_TYPE</returns> public static Object GetMyInventoryObject(int index, out INV_TYPE invtype) { Object objectfound = new Object(); INV_TYPE temp = INV_TYPE.NULL; OD_MyInventory.TryGetValue(index, out objectfound); if (objectfound.GetType().ToString() == "MyInventory.Folder") { temp = INV_TYPE.FOLDER; } else { temp = INV_TYPE.ITEM; } invtype = temp; return(objectfound); }
/// <summary> /// Helper to TreeViewToXML /// </summary> /// <param name="xmlw"></param> /// <param name="node"></param> public static void ImageWriteAttributeString(XmlTextWriter xmlw, TreeNode node) { INV_TYPE invtype = INV_TYPE.NULL; Object invobject = Utils.MIUtils.GetMyInventoryObjectByText(node.Text, out invtype); if (invtype == INV_TYPE.FOLDER) { //if it is the "Trash" can, then reassign properly if (node.Text == "Trash") { xmlw.WriteAttributeString("image", Convert.ToString(Getinv_type(((Folder)invobject).pref_type))); } else { xmlw.WriteAttributeString("image", Convert.ToString(Getinv_type(((Folder)invobject).type))); } } else { xmlw.WriteAttributeString("image", Convert.ToString(Getinv_type(((Item)invobject).type))); } }
public static string GetInvName(INV_TYPE invType) { switch (invType) { case INV_TYPE.INV_SPECIAL: return("专用发票"); case INV_TYPE.INV_COMMON: return("普通发票"); case INV_TYPE.INV_TRANSPORTATION: return("货物运输业增值税专用发票"); case INV_TYPE.INV_VEHICLESALES: return("机动车销售统一发票"); case INV_TYPE.INV_PTDZ: return("电子增值税普通发票"); case INV_TYPE.INV_JSFP: return("增值税普通发票(卷票)"); } return("废旧物资发票"); }
/// <summary> /// Search the OrderedDictionary index OD_MyInventory by Name string to return the SLMIV Folder or Item object. /// </summary> /// <param name="text_title">name string of inventory folder or item</param> /// <param name="invtype">INV_TYPE of the object found</param> /// <returns>Returns a FOLDER or ITEM object from inventory and item's INV_TYPE</returns> public static Object GetMyInventoryObjectByText(string text_title, out INV_TYPE invtype) { Object objectfound = new Object(); INV_TYPE temp = INV_TYPE.NULL; foreach (KeyValuePair<int, Object> pair in OD_MyInventory) { if (pair.Value.GetType().ToString() == "MyInventory.Folder") { temp = INV_TYPE.FOLDER; Folder ftemp = (Folder)pair.Value; if (ftemp.name == text_title) { objectfound = pair.Value; break; } } else { temp = INV_TYPE.ITEM; Item Itemp = (Item)pair.Value; if (Itemp.name == text_title) { objectfound = pair.Value; break; } } } invtype = temp; return objectfound; }
/// <summary> /// Search the OrderedDictionary index OD_MyInventory by index number to return the SLMIV Folder or Item object. /// </summary> /// <param name="index">index of the object in OD_MyInventory</param> /// <param name="invtype">INV_TYPE of the object found</param> /// <returns>Returns a FOLDER or ITEM object from inventory and item's INV_TYPE</returns> public static Object GetMyInventoryObject(int index, out INV_TYPE invtype) { Object objectfound = new Object(); INV_TYPE temp = INV_TYPE.NULL; OD_MyInventory.TryGetValue(index, out objectfound); if (objectfound.GetType().ToString() == "MyInventory.Folder") { temp = INV_TYPE.FOLDER; } else { temp = INV_TYPE.ITEM; } invtype = temp; return objectfound; }
/// <summary> /// Returns a MyInventory.Item object. /// </summary> /// <param name="uidkey">Name UUID Key</param> /// <param name="invtype">INV_TYPE object</param> /// <returns></returns> public static Object GetInvObj(string uidkey, OrderedDictionary<String, int> objectdict, out INV_TYPE invtype) { invtype = MIUtils.INV_TYPE.NULL; Object objinfo = new Object(); int iNodeindex = 0; objectdict.TryGetValue(uidkey, out iNodeindex); if (iNodeindex != -1) { MIUtils.INV_TYPE nodeObjtype; objinfo = MIUtils.GetMyInventoryObject(iNodeindex, out nodeObjtype); if (nodeObjtype == MIUtils.INV_TYPE.ITEM) { invtype = INV_TYPE.ITEM; } else invtype = INV_TYPE.FOLDER; } return objinfo; }
public void CreateMonthlyDataGrid(ref CustomStyleDataGrid dataGridView, int nYear, int nMonth, int nPeriod, INV_TYPE InvType) { try { dataGridView.ReadOnly = true; dataGridView.AllowUserToAddRows = false; DataTable table = new DataTable(); table.Columns.Add("项目名称"); table.Columns.Add("合计"); table.Columns.Add("17%"); table.Columns.Add("13%"); table.Columns.Add("6%"); table.Columns.Add("4%"); table.Columns.Add("其他"); TaxStatisData data = this.taxCard.GetMonthStatistics(nYear, nMonth, nPeriod); if (data != null) { List <string> item = new List <string>(); List <List <string> > list2 = new List <List <string> >(); List <string> list3 = new List <string> { "销项正废金额", "销项正数金额", "销项负废金额", "销项负数金额", "实际销售金额", "销项正废税额", "销项正数税额", "销项负废税额", "销项负数税额", "实际销项税额" }; for (int i = 0; i < data.get_Count(); i++) { InvAmountTaxStati stati = data.get_Item(i); if (stati == null) { return; } if ((stati.get_InvTypeStr().Length > 0) && (stati.get_InvTypeStr().Trim() == InvTypeEntity.GetInvName(InvType))) { item.Add(stati.get_Total().XXZFJE.ToString("0.00")); item.Add(stati.get_TaxClass17().XXZFJE.ToString("0.00")); item.Add(stati.get_TaxClass13().XXZFJE.ToString("0.00")); item.Add(stati.get_TaxClass6().XXZFJE.ToString("0.00")); item.Add(stati.get_TaxClass4().XXZFJE.ToString("0.00")); item.Add(stati.get_TaxClassOther().XXZFJE.ToString("0.00")); list2.Add(item); item = new List <string> { stati.get_Total().XXZSJE.ToString("0.00"), stati.get_TaxClass17().XXZSJE.ToString("0.00"), stati.get_TaxClass13().XXZSJE.ToString("0.00"), stati.get_TaxClass6().XXZSJE.ToString("0.00"), stati.get_TaxClass4().XXZSJE.ToString("0.00"), stati.get_TaxClassOther().XXZSJE.ToString("0.00"), item }; item = new List <string> { stati.get_Total().XXFFJE.ToString("0.00"), stati.get_TaxClass17().XXFFJE.ToString("0.00"), stati.get_TaxClass13().XXFFJE.ToString("0.00"), stati.get_TaxClass6().XXFFJE.ToString("0.00"), stati.get_TaxClass4().XXFFJE.ToString("0.00"), stati.get_TaxClassOther().XXFFJE.ToString("0.00"), item }; item = new List <string> { stati.get_Total().XXFSJE.ToString("0.00"), stati.get_TaxClass17().XXFSJE.ToString("0.00"), stati.get_TaxClass13().XXFSJE.ToString("0.00"), stati.get_TaxClass6().XXFSJE.ToString("0.00"), stati.get_TaxClass4().XXFSJE.ToString("0.00"), stati.get_TaxClassOther().XXFSJE.ToString("0.00"), item }; item = new List <string> { stati.get_Total().SJXSJE.ToString("0.00"), stati.get_TaxClass17().SJXSJE.ToString("0.00"), stati.get_TaxClass13().SJXSJE.ToString("0.00"), stati.get_TaxClass6().SJXSJE.ToString("0.00"), stati.get_TaxClass4().SJXSJE.ToString("0.00"), stati.get_TaxClassOther().SJXSJE.ToString("0.00"), item }; item = new List <string> { stati.get_Total().XXZFSE.ToString("0.00"), stati.get_TaxClass17().XXZFSE.ToString("0.00"), stati.get_TaxClass13().XXZFSE.ToString("0.00"), stati.get_TaxClass6().XXZFSE.ToString("0.00"), stati.get_TaxClass4().XXZFSE.ToString("0.00"), stati.get_TaxClassOther().XXZFSE.ToString("0.00"), item }; item = new List <string> { stati.get_Total().XXZSSE.ToString("0.00"), stati.get_TaxClass17().XXZSSE.ToString("0.00"), stati.get_TaxClass13().XXZSSE.ToString("0.00"), stati.get_TaxClass6().XXZSSE.ToString("0.00"), stati.get_TaxClass4().XXZSSE.ToString("0.00"), stati.get_TaxClassOther().XXZSSE.ToString("0.00"), item }; item = new List <string> { stati.get_Total().XXFFSE.ToString("0.00"), stati.get_TaxClass17().XXFFSE.ToString("0.00"), stati.get_TaxClass13().XXFFSE.ToString("0.00"), stati.get_TaxClass6().XXFFSE.ToString("0.00"), stati.get_TaxClass4().XXFFSE.ToString("0.00"), stati.get_TaxClassOther().XXFFSE.ToString("0.00"), item }; item = new List <string> { stati.get_Total().XXFSSE.ToString("0.00"), stati.get_TaxClass17().XXFSSE.ToString("0.00"), stati.get_TaxClass13().XXFSSE.ToString("0.00"), stati.get_TaxClass6().XXFSSE.ToString("0.00"), stati.get_TaxClass4().XXFSSE.ToString("0.00"), stati.get_TaxClassOther().XXFSSE.ToString("0.00"), item }; item = new List <string> { stati.get_Total().SJXXSE.ToString("0.00"), stati.get_TaxClass17().SJXXSE.ToString("0.00"), stati.get_TaxClass13().SJXXSE.ToString("0.00"), stati.get_TaxClass6().SJXXSE.ToString("0.00"), stati.get_TaxClass4().SJXXSE.ToString("0.00"), stati.get_TaxClassOther().SJXXSE.ToString("0.00"), item }; } } if (dataGridView.Rows.Count > 0) { int count = dataGridView.Rows.Count; while (count-- > 0) { dataGridView.Rows.RemoveAt(0); } } if (list2.Count != list3.Count) { MessageManager.ShowMsgBox("INP-253107", new string[] { "资料统计出错" }); } else { for (int j = 0; j < list3.Count; j++) { List <object> list4 = new List <object> { list3[j] }; object[] objArray = list2[j].ToArray(); for (int m = 1; m < table.Columns.Count; m++) { list4.Add(objArray[m - 1]); } object[] values = list4.ToArray(); table.Rows.Add(values); } dataGridView.DataSource = table; for (int k = 0; k < dataGridView.Columns.Count; k++) { dataGridView.Columns[k].SortMode = DataGridViewColumnSortMode.NotSortable; } } } } catch (Exception exception) { this.loger.Info(exception.Message); ExceptionHandler.HandleError(exception); } }
/// <summary> /// Returns a MyInventory.Item object. /// </summary> /// <param name="uidkey">Name UUID Key</param> /// <param name="invtype">INV_TYPE object</param> /// <returns></returns> public static Object GetInvObj(string uidkey, OrderedDictionary <String, int> objectdict, out INV_TYPE invtype) { invtype = MIUtils.INV_TYPE.NULL; Object objinfo = new Object(); int iNodeindex = 0; objectdict.TryGetValue(uidkey, out iNodeindex); if (iNodeindex != -1) { MIUtils.INV_TYPE nodeObjtype; objinfo = MIUtils.GetMyInventoryObject(iNodeindex, out nodeObjtype); if (nodeObjtype == MIUtils.INV_TYPE.ITEM) { invtype = INV_TYPE.ITEM; } else { invtype = INV_TYPE.FOLDER; } } return(objinfo); }
public string SetInvName(INV_TYPE _InvType, string strNewName) { this.m_strInvName = strNewName; return(this.m_strInvName); }
public InvTypeEntity() { this.m_invType = INV_TYPE.INV_SPECIAL; this.m_strInvName = "增值税专用发票"; }
public string SetInvName(INV_TYPE inv_TYPE_0, string string_0) { this.m_strInvName = string_0; return(this.m_strInvName); }