private void lstItemFixCssClass() { foreach (DataListItem item in lstItem.Items) { Label lblitemPOItemReceivedStatus = (Label)item.FindControl("lblPOItemReceivedStatus"); POItemReceivedStatus itemPOItemReceivedStatus = (POItemReceivedStatus)Enum.Parse(typeof(POItemReceivedStatus), lblitemPOItemReceivedStatus.Text); if (itemPOItemReceivedStatus == POItemReceivedStatus.Received) { item.CssClass = "ms-item-received-det"; } else if (item.ItemType == ListItemType.Item) { item.CssClass = ""; } else if (item.ItemType == ListItemType.AlternatingItem) { item.CssClass = "ms-alternating"; } } }
public void UpdateReceiveStatus(long POItemID, POItemReceivedStatus POItemReceivedStatus, decimal ReceivedQuantity) { try { string SQL = "UPDATE tblPOItems SET " + "POItemReceivedStatus = @POItemReceivedStatus, " + "OriginalQuantity = Quantity, " + "Quantity = @ReceivedQuantity " + "WHERE POItemID = @POItemID;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmPOItemReceivedStatus = new MySqlParameter("@POItemReceivedStatus", MySqlDbType.Int16); prmPOItemReceivedStatus.Value = POItemReceivedStatus.ToString("d"); cmd.Parameters.Add(prmPOItemReceivedStatus); MySqlParameter prmReceivedQuantity = new MySqlParameter("@ReceivedQuantity", MySqlDbType.Decimal); prmReceivedQuantity.Value = ReceivedQuantity; cmd.Parameters.Add(prmReceivedQuantity); MySqlParameter prmPOItemID = new MySqlParameter("@POItemID", MySqlDbType.Int64); prmPOItemID.Value = POItemID; cmd.Parameters.Add(prmPOItemID); base.ExecuteNonQuery(cmd); } catch (Exception ex) { { } throw base.ThrowException(ex); } }
public void UpdateReceiveStatus(long POItemID, POItemReceivedStatus POItemReceivedStatus, decimal ReceivedQuantity) { try { string SQL = "UPDATE tblPOItems SET " + "POItemReceivedStatus = @POItemReceivedStatus, " + "OriginalQuantity = Quantity, " + "Quantity = @ReceivedQuantity " + "WHERE POItemID = @POItemID;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmPOItemReceivedStatus = new MySqlParameter("@POItemReceivedStatus",MySqlDbType.Int16); prmPOItemReceivedStatus.Value = POItemReceivedStatus.ToString("d"); cmd.Parameters.Add(prmPOItemReceivedStatus); MySqlParameter prmReceivedQuantity = new MySqlParameter("@ReceivedQuantity",MySqlDbType.Decimal); prmReceivedQuantity.Value = ReceivedQuantity; cmd.Parameters.Add(prmReceivedQuantity); MySqlParameter prmPOItemID = new MySqlParameter("@POItemID",MySqlDbType.Int64); prmPOItemID.Value = POItemID; cmd.Parameters.Add(prmPOItemID); base.ExecuteNonQuery(cmd); } catch (Exception ex) { { } throw base.ThrowException(ex); } }
private void UpdateItemReceiveStatus(long POItemID, POItemReceivedStatus clsPOItemReceivedStatus, decimal ReceivedQuantity) { POItem clsPOItem = new POItem(); clsPOItem.UpdateReceiveStatus(POItemID, clsPOItemReceivedStatus, ReceivedQuantity); clsPOItem.CommitAndDispose(); }
protected void lstItem_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = (DataRowView)e.Item.DataItem; HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList"); chkList.Value = dr["POItemID"].ToString(); HyperLink lnkBarcode = (HyperLink)e.Item.FindControl("lnkBarcode"); lnkBarcode.Text = dr["Barcode"].ToString(); HyperLink lnkDescription = (HyperLink)e.Item.FindControl("lnkDescription"); lnkDescription.Text = dr["Description"].ToString(); lnkDescription.ToolTip = dr["ProductCode"].ToString(); lnkDescription.NavigateUrl = Constants.ROOT_DIRECTORY + "/MasterFiles/_Product/Default.aspx?task=" + Common.Encrypt("det", Session.SessionID) + "&id=" + Common.Encrypt(dr["ProductID"].ToString(), Session.SessionID); lnkBarcode.NavigateUrl = Constants.ROOT_DIRECTORY + "/MasterFiles/_Product/Default.aspx?task=" + Common.Encrypt("det", Session.SessionID) + "&id=" + Common.Encrypt(dr["ProductID"].ToString(), Session.SessionID); HyperLink lnkMatrixDescription = (HyperLink)e.Item.FindControl("lnkMatrixDescription"); if (dr["MatrixDescription"].ToString() != string.Empty && dr["MatrixDescription"].ToString() != null) { lnkMatrixDescription.Visible = true; lnkMatrixDescription.Text = dr["MatrixDescription"].ToString(); lnkMatrixDescription.NavigateUrl = Constants.ROOT_DIRECTORY + "/MasterFiles/_Product/_VariationsMatrix/Default.aspx?task=" + Common.Encrypt("det", Session.SessionID) + "&prodid=" + Common.Encrypt(dr["ProductID"].ToString(), Session.SessionID) + "&id=" + Common.Encrypt(dr["VariationMatrixID"].ToString(), Session.SessionID); } Label lblQuantity = (Label)e.Item.FindControl("lblQuantity"); lblQuantity.Text = Convert.ToDecimal(dr["Quantity"].ToString()).ToString("#,##0.##0"); Label lblProductUnitID = (Label)e.Item.FindControl("lblProductUnitID"); lblProductUnitID.Text = dr["ProductUnitID"].ToString(); Label lblProductUnitCode = (Label)e.Item.FindControl("lblProductUnitCode"); lblProductUnitCode.Text = dr["ProductUnitCode"].ToString(); Label lblUnitCost = (Label)e.Item.FindControl("lblUnitCost"); lblUnitCost.Text = Convert.ToDecimal(dr["UnitCost"].ToString()).ToString("#,##0.##0"); Label lblSellingPrice = (Label)e.Item.FindControl("lblSellingPrice"); lblSellingPrice.Text = Convert.ToDecimal(dr["SellingPrice"].ToString()).ToString("#,##0.##0"); Label lblDiscountApplied = (Label)e.Item.FindControl("lblDiscountApplied"); lblDiscountApplied.Text = Convert.ToDecimal(dr["DiscountApplied"].ToString()).ToString("#,##0.##0"); DiscountTypes DiscountType = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), dr["DiscountType"].ToString()); if (DiscountType == DiscountTypes.Percentage) { Label lblPercent = (Label)e.Item.FindControl("lblPercent"); lblPercent.Visible = true; } Label lblAmount = (Label)e.Item.FindControl("lblAmount"); lblAmount.Text = Convert.ToDecimal(dr["Amount"].ToString()).ToString("#,##0.##0"); Label lblVAT = (Label)e.Item.FindControl("lblVAT"); lblVAT.Text = Convert.ToDecimal(dr["VAT"].ToString()).ToString("#,##0.##0"); Label lblEVAT = (Label)e.Item.FindControl("lblEVAT"); lblEVAT.Text = Convert.ToDecimal(dr["EVAT"].ToString()).ToString("#,##0.##0"); Label lblisVATInclusive = (Label)e.Item.FindControl("lblisVATInclusive"); lblisVATInclusive.Text = Convert.ToBoolean(Convert.ToInt16(dr["isVATInclusive"].ToString())).ToString(); Label lblLocalTax = (Label)e.Item.FindControl("lblLocalTax"); lblLocalTax.Text = Convert.ToDecimal(dr["LocalTax"].ToString()).ToString("#,##0.##0"); Label lblRemarks = (Label)e.Item.FindControl("lblRemarks"); lblRemarks.Text = dr["Remarks"].ToString(); Label lblPOItemReceivedStatus = (Label)e.Item.FindControl("lblPOItemReceivedStatus"); POItemReceivedStatus clsPOItemReceivedStatus = (POItemReceivedStatus)Enum.Parse(typeof(POItemReceivedStatus), dr["POItemReceivedStatus"].ToString()); lblPOItemReceivedStatus.Text = clsPOItemReceivedStatus.ToString("d"); TextBox txtTagPriceCount = (TextBox)e.Item.FindControl("txtTagPriceCount"); ImageButton cmdPrintTagPriceBarCode = (ImageButton)e.Item.FindControl("cmdPrintTagPriceBarCode"); txtTagPriceCount.Visible = holderTagPrice.Visible; cmdPrintTagPriceBarCode.Visible = holderTagPrice.Visible; //if (holderTagPrice.Visible) //{ string strUnitCode = lblProductUnitCode.Text.ToUpper(); switch (strUnitCode) { case "CAN": case "BOX": case "PC": case "PCS": case "PIECE": case "BTL": case "BOT": case "BOTTLE": case "PACK": case "BNDL": decimal iQty = decimal.TryParse(lblQuantity.Text, out iQty) ? iQty : 1; int iQuotient, iRemainder; iQuotient = Math.DivRem(Convert.ToInt32(Math.Floor(iQty)), 2, out iRemainder); txtTagPriceCount.Text = (iRemainder == 1 ? (iQuotient + 1) : iQuotient).ToString("#,##0"); break; default: txtTagPriceCount.Text = "1"; break; } //} //For anchor HtmlGenericControl divExpCollAsst = (HtmlGenericControl)e.Item.FindControl("divExpCollAsst"); HtmlAnchor anchorDown = (HtmlAnchor)e.Item.FindControl("anchorDown"); anchorDown.HRef = "javascript:ToggleDiv('" + divExpCollAsst.ClientID + "')"; } }