コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             //Initilization at Pageload
             ddlTransHead.LoadAccountHeads(CPublic.GetCompanyID());
             Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions();
             DateTime newDate = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1);//From date(First day of the current month)
             txtFromDate.Text = newDate.ToString("dd-MMM-yyyy");
             txtToDate.Text   = DateTime.UtcNow.ToString("dd-MMM-yyyy");
             ddlCostCenter.LoadCost(CPublic.GetCompanyID());
             ddlTransHead.SelectedValue = "6";
             if (ddlTransHead.SelectedValue != "0")
             {
                 lblLedgerHead.InnerText = ddlTransHead.SelectedItem.Text;
             }
             else
             {
                 lblLedgerHead.InnerText = "Cash";
             }
             lblDate.InnerText = "From " + txtFromDate.Text + " to " + txtToDate.Text;
             literalGrid.Text  = fin.BindGrid(hiddenChildId.Value, ddlChildHead.SelectedValue, ddlTransHead.SelectedValue, txtFromDate.Text, txtToDate.Text, ddlCostCenter.SelectedValue);
         }
         catch (Exception)
         {
         }
     }
 }
コード例 #2
0
        public E_ERROR_CODE downloadIOSData(DateTime startDate, DateTime endDate)
        {
            E_ERROR_CODE errorCode        = E_ERROR_CODE.ERROR;
            string       message          = string.Empty;
            string       queryDataUrl     = string.Empty;
            string       dataFile         = string.Empty;
            string       iosDataStorePath = _AppsFlyerDataSpiderConfig.getIOSDataStorePath();

            string[] iosApplicationIds = _AppsFlyerDataSpiderConfig.getIOSApplicationIds();

            if (iosDataStorePath == null)
            {
                _SystemLog.writeLog2Console(LOG_LEVEL.ERR, "Get android data file store path failed.");
                return(E_ERROR_CODE.ERROR_GET_ANDROID_DATA_FILE_STORE_PATH_FAILED);
            }

            foreach (string androidApplicationId in iosApplicationIds)
            {
                queryDataUrl = _AppsFlyerDataSpiderConfig.getQueryDataUrl(startDate, endDate, androidApplicationId);
                dataFile     = string.Format("{0}/{1}_{2}.dat", iosDataStorePath, CPublic.getDateString(startDate), CPublic.getDateString(endDate));
                message      = string.Format("Query data url <{0}>, dataFile <{1}>.", queryDataUrl, dataFile);
                _SystemLog.writeLog2Console(LOG_LEVEL.DEBUG, message);
                errorCode = downloadData(queryDataUrl, _WebDriver, dataFile);
                if (errorCode != E_ERROR_CODE.OK)
                {
                    message = string.Format("ios application <{0}> download data failed, error code <{1}>.", androidApplicationId, errorCode);
                    _SystemLog.writeLog2Console(LOG_LEVEL.ERR, message);
                }
            }

            return(E_ERROR_CODE.OK);
        }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     hdApiUrl.Value = WebConfigurationManager.AppSettings["APIURL"].ToString();
     Entities.Master.Company c = new Entities.Master.Company();
     c = Entities.Master.Company.GetDetailsByLocation(CPublic.GetLocationID());
     imgLogo.ImageUrl = "data:image/jpeg;base64, " + c.LogoBase64;
 }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         DataTable dt = new DataTable();
         Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions();
         dt = fin.GetAccountGroups(CPublic.GetCompanyID());
         if (dt != null)
         {
             foreach (DataRow item in dt.Rows)
             {
                 ListItem items = new ListItem(item["name"].ToString(), item["id"].ToString());
                 ddlAccountGroups.Items.Add(items);
             }
         }
         dt = fin.GetAccountHeads(Convert.ToInt32(ddlAccountGroups.SelectedValue));
         if (dt != null)
         {
             foreach (DataRow item in dt.Rows)
             {
                 ListItem items = new ListItem(item["Fah_Name"].ToString(), item["Fah_ID"].ToString());
                 ddlTransHead.Items.Add(items);
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
コード例 #5
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["data"].ConnectionString);
        DataTable     dt = CPublic.getStudent(TextBox4.Text.Trim(), TextBox5.Text.Trim());

        if (dt.Rows.Count == 1)
        {
            //记住Cookie
            //Ctrl+K+D格式化程序   Ctrl+X删除一行
            // Response.Cookies["zhid"].Value = TextBox4.Text.Trim();

            DataClassesDataContext dc = new DataClassesDataContext();
            var a = from c in dc.guke where c.zhid.ToString() == TextBox4.Text.ToString() select c;
            foreach (var q in a)
            {
                Session["name"] = q.name;
                Session["zhid"] = q.zhid;
            }


            //密码验证成功,跳转到主页
            Response.Redirect("shouye.aspx");
        }
        else
        {
            //密码验证失败
            Response.Write("   <script>  window.alert('登录失败')      </script>      ");
        }
    }
コード例 #6
0
ファイル: Items.aspx.cs プロジェクト: radtek/BisellsInventory
        protected void btnSaveConfirmed_Click(object sender, EventArgs e)
        {
            try
            {
                Product product = new Product();
                product.ItemID       = Convert.ToInt32(hdItemId.Value);
                product.Name         = txtItemName.Text.Trim();
                product.UnitID       = Convert.ToInt32(ddlUOM.SelectedValue);
                product.TaxId        = Convert.ToInt32(ddlTax.SelectedValue);
                product.Description  = txtDescription.Text.Trim();
                product.ItemCode     = txtItemCode.Text.Trim();
                product.OEMCode      = txtOEM.Text.Trim();
                product.HSCode       = txtHSCode.Text.Trim();
                product.Barcode      = txtBarcode.Text.Trim();
                product.TypeID       = Convert.ToInt32(ddlType.SelectedValue);
                product.MRP          = Convert.ToDecimal(txtMrp.Text);
                product.CostPrice    = Convert.ToDecimal(txtCost.Text);
                product.SellingPrice = Convert.ToDecimal(txtSell.Text);
                //product.Remarks = txtRemarks.Text.Trim();
                product.CategoryID = Convert.ToInt32(ddlCategory.SelectedValue);
                product.GroupID    = Convert.ToInt32(ddlGroup.SelectedValue);
                product.BrandID    = Convert.ToInt32(ddlBrand.SelectedValue);
                product.CompanyId  = CPublic.GetCompanyID();
                product.CreatedBy  = CPublic.GetuserID();
                product.ModifiedBy = CPublic.GetuserID();
                product.Status     = Convert.ToInt32(ddlStatus.SelectedValue);
                OutputMessage result = null;
                if (product.ItemID == 0)
                {
                    result = product.Save();

                    if (result.Success)
                    {
                        Reset();
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "')", true);
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + result.Message + "')", true);
                    }
                }
                else
                {
                    result = product.Update();
                    if (result.Success)
                    {
                        Reset();
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "')", true);
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + result.Message + "')", true);
                    }
                }
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + ex.Message + "')", true);
            }
        }
コード例 #7
0
 protected void page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlAccountGroup.LoadAccountGroups(CPublic.GetCompanyID());
     }
 }
コード例 #8
0
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlDept.LoadDepartments(CPublic.GetCompanyID());
     }
 }
コード例 #9
0
        /// <summary>
        /// 清空执行环境状态数据
        /// </summary>
        public void cleanUp()
        {
            string message = string.Empty;

            if (_WebDriver == null)
            {
                return;
            }

            clearAllCookies();
            try
            {
                _WebDriver.Quit();
            }
            catch (Exception ex)
            {
                message = string.Format("Exit webdriver faild,error message<{0}>.", ex.Message);
                _SystemLog.writeLog2Console(LOG_LEVEL.ERR, message);
            }

            try
            {
                _WebDriver.Dispose();
            }
            catch (Exception ex)
            {
                message = string.Format("Dispose webdriver faild,error message<{0}>.", ex.Message);
                _SystemLog.writeLog2Console(LOG_LEVEL.ERR, message);
            }

            _WebDriver = null;

            CPublic.killProcess(PhantomjsDriverProcessId);
        }
コード例 #10
0
ファイル: User.aspx.cs プロジェクト: radtek/BisellsInventory
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlEmpName.LoadEmployee(CPublic.GetCompanyID());
         ddlLoc.LoadLocations(CPublic.GetCompanyID());
     }
 }
コード例 #11
0
        protected void btnSaveConfirmed_Click(object sender, EventArgs e)
        {
            try
            {
                Entities.Payroll.OfficeShift off = new Entities.Payroll.OfficeShift();
                off.ID               = Convert.ToInt32(hdId.Value);
                off.Name             = txtName.Text.Trim();
                off.MondayInTime     = Convert.ToDateTime(txtMonClockIn.Text);
                off.MondayOutTime    = Convert.ToDateTime(txtMonClockOut.Text);
                off.TuesdayInTime    = Convert.ToDateTime(txtTueClockIn.Text);
                off.TuesdayOutTime   = Convert.ToDateTime(txtTueClockOut.Text);
                off.WednesdayInTime  = Convert.ToDateTime(txtWedClockIn.Text);
                off.WednesdayOutTime = Convert.ToDateTime(txtWedClockOut.Text);
                off.ThursdayInTime   = Convert.ToDateTime(txtThuClockIn.Text);
                off.ThursdayOutTime  = Convert.ToDateTime(txtThuClockOut.Text);
                off.FridayInTime     = Convert.ToDateTime(txtFriClockIn.Text);
                off.FridayOutTime    = Convert.ToDateTime(txtFriClockOut.Text);
                off.SaturdayInTime   = Convert.ToDateTime(txtSatClockIn.Text);
                off.SaturdayOuttime  = Convert.ToDateTime(txtSatClockOut.Text);
                off.SundayInTime     = Convert.ToDateTime(txtSunClockIn.Text);
                off.SundayOutTime    = Convert.ToDateTime(txtSunClockOut.Text);
                off.CompanyId        = CPublic.GetCompanyID();
                off.CreatedBy        = CPublic.GetuserID();
                off.ModifiedBy       = CPublic.GetuserID();

                Entities.OutputMessage result = null;
                if (off.ID == 0)
                {
                    result = off.Save();
                    if (result.Success)
                    {
                        Reset();
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true);
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true);
                    }
                }
                else
                {
                    result = off.Update();
                    if (result.Success)
                    {
                        Reset();
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true);
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true);
                    }
                }
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + "')", true);
            }
        }
コード例 #12
0
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            var Employees = Entities.Payroll.Employee.GetDetails(CPublic.GetCompanyID()).Where(x => x.Status != 0).ToList();

            for (int i = 0; i < Employees.Count; i++)
            {
                ltrEmpList.Text += @"<tr><td><div class='checkbox mark-employee'> <input type='checkbox'/> <label for=''></label> </div></td><td data-empid='" + Employees[i].ID + "'>" + Employees[i].FirstName + "&nbsp;" + Employees[i].LastName + "</td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td></tr>";
            }
        }
コード例 #13
0
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlNationality.LoadCountry(CPublic.GetCompanyID());
         ddlDept.LoadDepartments(CPublic.GetCompanyID());
         ddlDesig.LoadDesignation(CPublic.GetCompanyID());
     }
 }
コード例 #14
0
 protected void page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlReverseHead.LoadAccountHeads(CPublic.GetCompanyID());
         ddlParentGroup.LoadAccountGroups(CPublic.GetCompanyID());
         FillTree();
     }
 }
コード例 #15
0
 protected void page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlParentGroup.LoadAccountGroups(CPublic.GetCompanyID());
         Entities.Finance.AccountGroup account = new Entities.Finance.AccountGroup();
         moduleTree.Nodes.Clear();
         account.BindTree(moduleTree, CPublic.GetCompanyID());
     }
 }
コード例 #16
0
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlEmpolyee.LoadEmployee(CPublic.GetCompanyID());
         ddlUserLocation.LoadLocations(CPublic.GetCompanyID());
         ddlUser.LoadUsers(CPublic.GetCompanyID());
         ddlGroup.LoadUserGroups();
     }
 }
コード例 #17
0
        /// <summary>
        /// 绩效报告存储路径
        /// </summary>
        /// <returns>绩效报告存储路径</returns>
        internal string getPerformanceReportDataStorePath()
        {
            string configItemValue = string.Format("{0}", _AppsflyerConfig.getConfigItem(CONFIG_ITEM_PERFORMANCE_REPORT_DATA));

            if (configItemValue == null)
            {
                return(string.Format("{0}/{1}", CPublic.getAppStartPath(), "performance_report_data"));
            }

            return(configItemValue);
        }
コード例 #18
0
        private string getDataStorePath()
        {
            string configItemValue = string.Format("{0}", _AppsflyerConfig.getConfigItem(CONFIG_ITEM_USER_DATA_PATH));

            if (configItemValue == null)
            {
                return(string.Format("{0}/{1}", CPublic.getAppStartPath(), "data"));
            }

            return(configItemValue);
        }
コード例 #19
0
ファイル: Items.aspx.cs プロジェクト: radtek/BisellsInventory
 protected void page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlUOM.LoadUnits(CPublic.GetCompanyID());
         ddlBrand.LoadBrands(CPublic.GetCompanyID());
         ddlCategory.LoadCategories(CPublic.GetCompanyID());
         ddlTax.LoadTaxes(CPublic.GetCompanyID());
         ddlGroup.LoadGroups(CPublic.GetCompanyID());
         ddlType.LoadTypes(CPublic.GetCompanyID());
     }
 }
コード例 #20
0
 protected void btnSaveConfirmed_Click(object sender, EventArgs e)
 {
     try
     {
         Entities.Finance.AccountOpeningBalance OpeningBalance = new Entities.Finance.AccountOpeningBalance();
         OpeningBalance.AccountHeadID = Convert.ToInt32(ddlAccountHead.SelectedValue);
         OpeningBalance.ChildheadID   = Convert.ToInt32(ddlSubAccountHead.SelectedValue);
         OpeningBalance.Balance       = Convert.ToDecimal(txtOpeningBalance.Text);
         OpeningBalance.OpeningDate   = Convert.ToDateTime(txtOpeningDate.Text);
         OpeningBalance.CreatedBy     = CPublic.GetuserID();
         OpeningBalance.SQLtable      = hdSqlTable.Value;
         OpeningBalance.ModifiedBy    = CPublic.GetuserID();
         OpeningBalance.isDebit       = Convert.ToInt32(ddlISDebit.SelectedValue);
         OpeningBalance.ID            = Convert.ToInt32(hdItemId.Value);
         try
         {
             OutputMessage result = new OutputMessage();
             if (OpeningBalance.ID == 0)
             {
                 result = OpeningBalance.Save();
                 if (result.Success)
                 {
                     ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true);
                     reset();
                 }
                 else
                 {
                     ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + result.Message + "')", true);
                 }
             }
             else
             {
                 result = OpeningBalance.Update();
                 if (result.Success)
                 {
                     ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true);
                     reset();
                 }
                 else
                 {
                     ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + result.Message + "')", true);
                 }
             }
         }
         catch (Exception)
         {
         }
     }
     catch (Exception)
     {
     }
 }
コード例 #21
0
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     ddlCostCenter.LoadCost(CPublic.GetCompanyID());
     ddlJob.LoadJobs(CPublic.GetCompanyID());
     lblOrderNo.Text = Entities.Register.Register.GetOrderNo(Publics.CPublic.GetCompanyID(), Publics.CPublic.GetFinYear(), "PRQ");
     if (Entities.Application.Settings.IsAutoRoundOff())
     {
         txtRoundOff.Enabled = false;
     }
     else
     {
         txtRoundOff.Enabled = true;
     }
 }
コード例 #22
0
 private void bindgrid()
 {
     try
     {
         Entities.Finance.VoucherSettings Voucher = new Entities.Finance.VoucherSettings();
         DataSet ds = new DataSet();
         ds = Voucher.GetVoucherSetings(Convert.ToInt32(CPublic.GetCompanyID()), Convert.ToInt32(ddlVoucherType.SelectedValue), Convert.ToInt32(ddlgroupBy.SelectedValue));
         gvAccounts.DataSource = ds;
         gvAccounts.DataBind();
     }
     catch (Exception)
     {
     }
 }
コード例 #23
0
 private void FillTree()
 {
     try
     {
         Entities.Finance.AccountHeadMaster account = new Entities.Finance.AccountHeadMaster();
         TreeNode tree = new TreeNode();
         tree = account.GetTree(CPublic.GetCompanyID());
         moduleTree.Nodes.Add(tree);
         moduleTree.CollapseAll();
     }
     catch (Exception)
     {
     }
 }
コード例 #24
0
 protected void ddlVoucherType_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (Session["type"].ToString() == "Expense")
         {
             Entities.Finance.ExpenseEntry.getAccountGroup(ddlfrommain, Convert.ToInt32(ddlVoucherType.SelectedValue));
             ddltomain.LoadAccountHeadsVoucher(CPublic.GetCompanyID());
         }
     }
     catch (Exception)
     {
     }
 }
コード例 #25
0
 protected void btnSaveConfirmed_Click(object sender, EventArgs e)
 {
     try
     {
         Entities.Location location = new Entities.Location();
         location.ID            = Convert.ToInt32(hdLocationId.Value);
         location.Name          = txtName.Text.Trim();
         location.Address1      = txtAddress1.Text.Trim();
         location.Address2      = txtAddress2.Text.Trim();
         location.Contact       = txtContact.Text.Trim();
         location.ContactPerson = txtContactPerson.Text.Trim();
         location.RegId1        = txtRegId1.Text.Trim();
         location.RegId2        = txtRegId2.Text.Trim();
         location.Status        = Convert.ToInt32(ddlStatus.SelectedValue);
         location.CompanyId     = CPublic.GetCompanyID();
         location.CreatedBy     = CPublic.GetuserID();
         location.ModifiedBy    = CPublic.GetuserID();
         OutputMessage result = null;
         if (location.ID == 0)
         {
             result = location.Save();
             if (result.Success)
             {
                 Reset();
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true);
             }
             else
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true);
             }
         }
         else
         {
             result = location.Update();
             if (result.Success)
             {
                 Reset();
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true);
             }
             else
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true);
             }
         }
     }
     catch (Exception ex)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + "')", true);
     }
 }
コード例 #26
0
 protected void page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             ddlVoucherType.LoadVoucherTypes(CPublic.GetCompanyID());
             bindgrid();
         }
         catch (Exception)
         {
         }
     }
 }
コード例 #27
0
 protected void btnSaveConfirmed_Click(object sender, EventArgs e)
 {
     try
     {
         Entities.Master.Despatch despatch = new Entities.Master.Despatch();
         despatch.ID                 = Convert.ToInt32(hdDespatchId.Value);
         despatch.Name               = txtName.Text.Trim();
         despatch.Address            = txtAddress.Text.Trim();
         despatch.PhoneNo            = txtPhone.Text.Trim();
         despatch.MobileNo           = txtMobile.Text.Trim();
         despatch.ContactPerson      = txtContactPerson.Text.Trim();
         despatch.ContactPersonPhone = txtContactPersonPhone.Text.Trim();
         despatch.Narration          = txtNarration.Text.Trim();
         despatch.Status             = Convert.ToInt32(ddlStatus.SelectedValue);
         despatch.CompanyId          = CPublic.GetCompanyID();
         despatch.CreatedBy          = CPublic.GetuserID();
         despatch.ModifiedBy         = CPublic.GetuserID();
         OutputMessage result = null;
         if (despatch.ID == 0)
         {
             result = despatch.Save();
             if (result.Success)
             {
                 Reset();
                 ClientScript.RegisterStartupScript(GetType(), "message", "successAlert('" + result.Message + "');", true);
             }
             else
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true);
             }
         }
         else
         {
             result = despatch.Update();
             if (result.Success)
             {
                 Reset();
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true);
             }
             else
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true);
             }
         }
     }
     catch (FormatException ex)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('Enter a Valid despatch')", true);
     }
 }
コード例 #28
0
 protected void btnSaveConfirmed_Click(object sender, EventArgs e)
 {
     try
     {
         Entities.Finance.AccountGroup Account = new Entities.Finance.AccountGroup();
         Account.Id          = Convert.ToInt32(hdItemId.Value);
         Account.Name        = txtAccountGroupName.Text;
         Account.Disable     = Convert.ToInt32(ddlStatus.SelectedValue);
         Account.Description = txtDescription.Text;
         Account.Depth       = 1;
         Account.ParentId    = Convert.ToInt32(ddlParentGroup.SelectedValue);
         Account.Company     = CPublic.GetCompanyID();
         Account.AccountType = Convert.ToInt32(ddlAccountNature.SelectedValue);
         Account.CreatedBy   = CPublic.GetuserID();
         Account.IsAffectGP  = Convert.ToInt32(ddlIsAffectGrossProfit.SelectedValue);
         Account.ModifiedBy  = CPublic.GetuserID();
         OutputMessage Result = null;
         if (Account.Id == 0)
         {
             Result = Account.Save();
             if (Result.Success)
             {
                 Reset();
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + Result.Message + "');window.setTimeout(function(){window.location.href = '/Finance/AccountGroup';}, 3000); ", true);
             }
             else
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + Result.Message + "')", true);
             }
         }
         else
         {
             Result = Account.Update();
             if (Result.Success)
             {
                 Reset();
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + Result.Message + "');window.setTimeout(function(){window.location.href = '/Finance/AccountGroup';}, 3000);", true);
             }
             else
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + Result.Message + "')", true);
             }
         }
     }
     catch (Exception)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('Enter a Valid Group')", true);
     }
 }
コード例 #29
0
        protected void btnSaveConfirmed_Click(object sender, EventArgs e)
        {
            try
            {
                Entities.Category Cat = new Entities.Category();
                Cat.ID         = Convert.ToInt32(hdItemId.Value);
                Cat.Name       = txtCategoryName.Text.Trim();
                Cat.Order      = Convert.ToInt32(txtCategoryOrder.Text);
                Cat.Status     = Convert.ToInt32(ddlCategoryStatus.SelectedValue);
                Cat.CompanyId  = CPublic.GetCompanyID();
                Cat.CreatedBy  = CPublic.GetuserID();
                Cat.ModifiedBy = CPublic.GetuserID();


                OutputMessage result = null;

                if (Cat.ID == 0)
                {
                    result = Cat.Save();
                    if (result.Success)
                    {
                        Reset();
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true);
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true);
                    }
                }
                else
                {
                    result = Cat.Update();
                    if (result.Success)
                    {
                        Reset();
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true);
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true);
                    }
                }
            }
            catch (FormatException)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('Enter a Valid Order')", true);
            }
        }
コード例 #30
0
 protected void btnSaveConfirmed_Click(object sender, EventArgs e)
 {
     try
     {
         Entities.Finance.VoucherType Voucher = new Entities.Finance.VoucherType();
         Voucher.ID               = Convert.ToInt32(hdItemId.Value);
         Voucher.IsDebit          = Convert.ToInt32(ddlIsDebit.SelectedValue);
         Voucher.Name             = txtVoucherTypeName.Text;
         Voucher.CreatedBy        = CPublic.GetuserID();
         Voucher.Disable          = Convert.ToInt32(ddlDisable.SelectedValue);
         Voucher.Numbering        = Convert.ToInt32(ddlNumbering.SelectedValue);
         Voucher.NumberStartFrom  = Convert.ToInt32(txtNumberingStarts.Text);
         Voucher.RestartNumber    = Convert.ToInt32(ddlRestartsOn.SelectedValue);
         Voucher.DisplayInJournal = Convert.ToInt32(ddlDisplayInJournal.SelectedValue);
         Voucher.ModifiedBy       = CPublic.GetuserID();
         OutputMessage Result = null;
         if (Voucher.ID == 0)
         {
             Result = Voucher.Save();
             if (Result.Success)
             {
                 Reset();
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + Result.Message + "');", true);
             }
             else
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + Result.Message + "')", true);
             }
         }
         else
         {
             Result = Voucher.Update();
             if (Result.Success)
             {
                 Reset();
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + Result.Message + "');", true);
             }
             else
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + Result.Message + "')", true);
             }
         }
     }
     catch (Exception ex)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('Something Went Wrong')", true);
     }
 }