private void updateAssetDepot()
        {
            DataSet ds = oAssetOrder.Get(intRequest, intItem, intNumber);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr = ds.Tables[0].Rows[0];

                oAssetOrder.UpdateAssetOrderDepotDateReceived(Int32.Parse(dr["OrderId"].ToString()),
                                                              Int32.Parse(ddlDepot.SelectedValue),
                                                              DateTime.Now,
                                                              intProfile);
            }
        }
Exemple #2
0
        protected void AddUpdateAssets()
        {
            int intOrderId = 0;

            intOrderId = Int32.Parse(hdnOrderId.Value);

            oAssetOrder.UpdateAssetOrderDepotDateReceived(intOrderId,
                                                          Int32.Parse(ddlDepot.SelectedValue),
                                                          DateTime.Parse(txtDateReceived.Text.Trim()),
                                                          intProfile);

            foreach (DataListItem dlItem in dlAssetList.Items)
            {
                HiddenField hdnAssetId                    = (HiddenField)dlItem.FindControl("hdnAssetId");
                CheckBox    chkSelectAsset                = (CheckBox)dlItem.FindControl("chkSelectAsset");
                CheckBox    chkAssetReturn                = (CheckBox)dlItem.FindControl("chkAssetReturn");
                Label       lblAssetListSerialNo          = (Label)dlItem.FindControl("lblAssetListSerialNo");
                Label       lblAssetListAssetTag          = (Label)dlItem.FindControl("lblAssetListAssetTag");
                Label       lblAssetListAssetScanDateTime = (Label)dlItem.FindControl("lblAssetListAssetScanDateTime");

                TextBox txtAssetListComments = (TextBox)dlItem.FindControl("txtAssetListComments");

                if (chkSelectAsset.Checked == true)
                {
                    if (hdnAssetId.Value != "")//Update Asset
                    {
                        oAsset.UpdateReturned(Int32.Parse(hdnAssetId.Value),
                                              (chkAssetReturn.Checked == true ? 1 : 0),
                                              txtAssetListComments.Text);
                    }
                    else //Insert Asset
                    {
                        int intAsset = oAsset.Add(Int32.Parse(hdnOrderId.Value), Int32.Parse(ddlDepot.SelectedValue),
                                                  Int32.Parse(hdnModel.Value), lblAssetListSerialNo.Text.Trim().ToUpper(),
                                                  lblAssetListAssetTag.Text.Trim().ToUpper(),
                                                  (int)AssetStatus.Arrived, intProfile,
                                                  DateTime.Parse(lblAssetListAssetScanDateTime.Text), 0, 1,
                                                  (chkAssetReturn.Checked == true?1:0), txtAssetListComments.Text);
                        hdnAssetId.Value = intAsset.ToString();
                    }
                }
            }
        }