コード例 #1
0
 private void LoadDeptID()
 {
     GarasERP.User user = new GarasERP.User();
     if (user.LoadByPrimaryKey(UserID))
     {
         try
         {
             UserDeptID = user.DepartmentID;
         }
         catch (Exception ex)
         {
             UserDeptID = -1;
         }
     }
 }
コード例 #2
0
        protected void BTN_Finish_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.Request.QueryString.Count > 0 && Page.Request.QueryString["RID"] != null)
                {
                    string ID     = GarasERP.Encrypt_Decrypt.Decrypt(Page.Request.QueryString["RID"].ToString(), key);
                    long   RID    = 0;
                    bool   hasNew = false;
                    if (long.TryParse(ID, out RID) && RID > 0)
                    {
                        DailyReport report = new DailyReport();

                        report.Where.ID.Value     = RID;
                        report.Where.Status.Value = "Pending Verification";
                        if (report.Query.Load())
                        {
                            if (report.DefaultView != null && report.DefaultView.Count > 0)
                            {
                                report.Status       = "Completed";
                                report.ModifiedDate = DateTime.Now;
                                report.ModifiedBy   = UserID;
                                // report.Note =
                                report.Review        = double.Parse(DDl_Review.SelectedValue);
                                report.ReviewComment = TXT_Desc.Text.Trim();
                                report.ReviewDate    = DateTime.Now;
                                report.Reviewed      = true;
                                report.ReviewedBy    = UserID;

                                report.Save();

                                string UserName = "";
                                long   BranchID = 0;
                                User   user     = new GarasERP.User();
                                if (user.LoadByPrimaryKey(UserID))
                                {
                                    UserName = user.FirstName + " " + user.LastName;
                                    if (user.s_BranchID != "")
                                    {
                                        BranchID = user.BranchID;
                                    }
                                }



                                Page.Response.Redirect("Reports.aspx", false);
                            }
                            else
                            {
                                LBL_MSG.Visible = true;
                                LBL_MSG.Text    = "Please Select Correct Report For edit";
                            }
                        }
                        else
                        {
                            LBL_MSG.Visible = true;
                            LBL_MSG.Text    = "Please Select Correct Report For edit";
                        }
                    }
                    else
                    {
                        LBL_MSG.Visible = true;
                        LBL_MSG.Text    = "Please Select Correct Report For edit";
                    }
                }
                else
                {
                    LBL_MSG.Visible = true;
                    LBL_MSG.Text    = "Please Select Correct Report For edit";
                }


                ///////////////////
            }
            catch (Exception ex)
            {
                LBL_MSG.Visible = true;
                LBL_MSG.Text    = "btn_Save:" + ex.Message;
                // Logger.LogException(ex);
            }
        }