Beispiel #1
0
 protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     //Account account = ASPxTreeList1.FocusedNode.DataItem as Account;
     //CriteriaOperator critera = new BinaryOperator("AccountId!Key", account.AccountId);
     //GeneralLedgerXPO.Criteria = critera.ToString();
     //ASPxGridView1.DataBind();
 }
    protected void grid_Transport_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        string s = e.Parameters;

        try
        {
            if (s == "Photo")
            {
                if (this.dsJobPhoto.FilterExpression == "1=0")
                {
                    ASPxPageControl pageControl = this.grid_Transport.FindEditFormTemplateControl("pageControl") as ASPxPageControl;
                    ASPxTextBox     refNo       = pageControl.FindControl("txt_JobNo") as ASPxTextBox;
                    this.dsJobPhoto.FilterExpression = string.Format("JobType='Tpt' and RefNo='{0}'", refNo.Text);
                }
            }
            if (s == "Save")
            {
                SaveJob();
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message + ex.StackTrace);
        }
    }
    protected void grid_ref_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        string       refN = e.Parameters;
        ASPxGridView grd  = sender as ASPxGridView;

        if (refN == "Photo")
        {
            if (this.dsJobPhoto.FilterExpression == "1=0")
            {
                ASPxPageControl pageControl = grd.FindEditFormTemplateControl("pageControl") as ASPxPageControl;
                ASPxTextBox     refNo       = pageControl.FindControl("txt_RefN") as ASPxTextBox;
                this.dsJobPhoto.FilterExpression = "JobClass='E' and RefNo='" + refNo.Text + "'";//
            }
        }
        else if (refN == "Save")
        {
            Save();
        }
        else if (refN == "Delete")
        {
            // ASPxCheckBox cb_de =(ASPxCheckBox)grid_ref.FindControl

            //if (cb_Delete.Checked == true)
            // {
            //    string sql = "delete from SeaAttachment where SequenceId="+SafeValue.SafeInt(txt_ID.Text,0);
            // }
        }
    }
Beispiel #4
0
        protected void grdPaymentVoucher_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
        {
            string[] args = e.Parameters.Split('|');
            switch (args[0])
            {
            case "delete":
                try
                {
                    if (args.Length > 1)
                    {
                        Guid recordId = Guid.Parse(args[1]);
                        PaymentVouchesBO.DeleteLogical(recordId);
                        grdPaymentVoucher.JSProperties.Add("cpEvent", "deleted");
                    }
                    else
                    {
                        throw new Exception("Must be pass id of the record");
                    }
                }
                catch (Exception)
                {
                    throw;
                }
                break;

            default:
                break;
            }
        }
    protected void grid_Export_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        string s = e.Parameters;

        if (s == "Photo")
        {
            if (this.dsJobPhoto.FilterExpression == "1=0")
            {
                ASPxGridView    grd         = sender as ASPxGridView;
                ASPxPageControl pageControl = grd.FindEditFormTemplateControl("pageControl_Hbl") as ASPxPageControl;
                ASPxTextBox     HNo         = pageControl.FindControl("txtHouseId") as ASPxTextBox;
                //this.dsJobPhoto.FilterExpression = "JobClass='I' and RefNo='" + refNo.Text + "'";
                string    sql = "select RefNo,JobNo from air_job where Id='" + HNo.Text + "'";
                DataTable tab = C2.Manager.ORManager.GetDataSet(sql).Tables[0];
                if (tab.Rows.Count > 0)
                {
                    string refNo = tab.Rows[0]["RefNo"].ToString();
                    string jobNo = tab.Rows[0]["JobNo"].ToString();
                    this.dsJobPhoto.FilterExpression = string.Format("JobType='AE' and RefNo='{0}' and JobNo='{1}'", refNo, jobNo);
                }
            }
        }
        if (s == "Save")
        {
            SaveJob();
        }
    }
Beispiel #6
0
    protected void grid_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        Dictionary <int, string> dictionary = Session["layout"] as Dictionary <int, string>;

        if (dictionary == null || Session["rowscount"] == null || Session["fields"] == null)
        {
            return;
        }

        for (int i = 0; i < grid.Columns.Count; i++)
        {
            grid.UnGroup(grid.Columns[i]);
        }
        grid.CollapseAll();

        string[] fields = Session["fields"].ToString().Split(';');
        if (fields[0] == string.Empty)
        {
            return;
        }
        foreach (string field in fields)
        {
            grid.GroupBy(grid.Columns[field]);
        }
        for (int i = 0; i < Convert.ToInt32(Session["rowscount"]); i++)
        {
            if (dictionary.ContainsKey(i))
            {
                grid.ExpandRow(i);
            }
        }
    }
Beispiel #7
0
        protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
        {
            string FUNC1 = "", BC1, ZD1, GZDD1 = "", MACHINENAME1;

            if (txtChose.Text.Trim() != "")
            {
                FUNC1 = txtChose.Value.ToString();
            }

            BC1 = txtBc.Text.Trim();
            ZD1 = txtSCode.Text.Trim();
            if (txtPCode.Text.Trim() != "")
            {
                GZDD1 = txtPCode.Value.ToString();
            }
            MACHINENAME1 = MachineName;
            string sql = "DELETE FROM RSTZZPQD WHERE MACHINENAME='" + MachineName + "'";

            dc.ExeSql(sql);
            string InSql = "INSERT INTO RSTZZPQD (GHTM,SO,RQSJ,GZRQ,ZDMC,GGXHMC,YGMC,BCMC,BZMC,MACHINENAME,JHDM) "
                           + " SELECT a.SN,a.PLAN_SO,a.START_TIME,a.WORK_DATE,c.STATION_NAME,a.PRODUCT_MODEL,b.user_name,d.shift_name,e.team_name,'" + MachineName + "',a.PLAN_CODE "
                           + " FROM DATA_COMPLETE a left join code_user b on a.user_id=b.user_code left join code_station c on c.station_code=a.station_code left join code_shift d on a.shift_code=d.shift_code left join code_team e on e.team_code=a.team_code WHERE 1=1 ";

            if (FUNC1 == "BC")
            {
                if (BC1 == "全部" || BC1 == "")
                {
                    InSql = InSql + " and WORK_DATE=to_date('" + ASPxDateEdit1.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') ";
                }
                else
                {
                    InSql = InSql + " and WORK_DATE=to_date('" + ASPxDateEdit1.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') and d.shift_name='" + BC1 + "'";
                }
                if (ZD1 == "全部" || ZD1 == "")
                {
                    InSql = InSql + " and a.pline_code='" + GZDD1 + "' ";
                }
                else
                {
                    InSql = InSql + " and a.pline_code='" + GZDD1 + "' and c.STATION_NAME='" + ZD1 + "' ";
                }
            }
            else
            {
                InSql = InSql + " and WORK_DATE>=to_date('" + ASPxDateEdit1.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') and WORK_DATE<=to_date('" + ASPxDateEdit2.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') ";
                if (ZD1 == "全部" || ZD1 == "")
                {
                    InSql = InSql + " and a.pline_code='" + GZDD1 + "' ";
                }
                else
                {
                    InSql = InSql + " and a.pline_code='" + GZDD1 + "' and c.STATION_NAME='" + ZD1 + "' ";
                }
            }
            dc.ExeSql(InSql);

            setCondition();
            ASPxGridView1.Selection.UnselectAll();
        }
Beispiel #8
0
    //protected void ASPxGridView1_Init(object sender, EventArgs e)
    //{
    //    GridViewDataHyperLinkColumn colLink = new GridViewDataHyperLinkColumn();//实例化一个超链接列
    //    colLink.Caption = "下载吧";//设置列头
    //    colLink.PropertiesHyperLinkEdit.Text = "这是个链接";//显示链接的名称
    //    colLink.PropertiesHyperLinkEdit.TextField = "LinkName";//显示链接名称要绑定的字段
    //    colLink.FieldName = "LinkURL";//该列绑定的字段
    //    colLink.PropertiesHyperLinkEdit.NavigateUrlFormatString = "{0}";//链接地址就是该列绑定的字段
    //    colLink.Visible = true;
    //    colLink.Width = 200;
    //    ASPxGridView1.Columns.Add(colLink);//把该列添加到ASPxGridview
    //}

    protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        //your server-side code
        ASPxGridView grid = (ASPxGridView)sender;

        Session["rmesid"] = "";
        Response.Redirect(HttpContext.Current.Request.Url.ToString() + "/qms2101.aspx");
    }
Beispiel #9
0
        protected void gridDSNVNghiViec_CallBack(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
        {
            decimal   unitid = Convert.ToDecimal(cmbDonVi.Value);
            DataTable tb     = SqlHelper.ExecuteDataset(strconn, "[HRM_GetEmployeesNghiViecByUnitid]", unitid).Tables[0];

            gridDSNVNghiViec.DataSource = tb;
            gridDSNVNghiViec.DataBind();
        }
Beispiel #10
0
 protected void ASPxGridView2_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     if (txtSCode.Text.Trim() == "")
     {
         return;
     }
     setCondition();
 }
Beispiel #11
0
    protected void ASPxGridView3_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        DataTable Table1 = new DataTable();

        ASPxGridView3.DataSource = Table1;
        ASPxGridView3.DataBind();
        setCondition();
    }
Beispiel #12
0
 protected void grd_ListUser_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     string[] para = e.Parameters.Split(',');
     if ((para[0].Equals("Refresh")))
     {
         loadListUsers(trlDepartmentMenu.FocusedNode);
     }
     if (para[0].Equals("Delete"))
     {
         string id = para.Count <string>() == 2 ? para[1] : String.Empty;
         if (id != "")
         {
             DepartmentBO checkID               = new DepartmentBO();
             bool         checkBill             = checkID.checkExistPersonInBill(session, Guid.Parse(id));
             bool         checkVouchesActor     = checkID.checkExistPersonInVouchesActor(session, Guid.Parse(id));
             bool         checkStock            = checkID.checkExistPersonInStockCartActor(session, Guid.Parse(id));
             bool         checkSpecialPrivilege = checkID.checkExistPersonInSpecialPrivilege(session, Guid.Parse(id));
             bool         checkBillActor        = checkID.checkExistPersonInBillActor(session, Guid.Parse(id));
             //bool checkDepartmentPerson = checkID.checkExistPersonInDepartmentPerson(session, Guid.Parse(id));
             //bool checkLoginAccount = checkID.checkExistPersonInLoginAccount(session, Guid.Parse(id));
             if (checkBill || checkVouchesActor || checkStock || checkSpecialPrivilege ||
                 checkBillActor)
             {
                 throw new Exception("Người dùng này không xóa được!");
             }
             else
             {
                 Person p = session.GetObjectByKey <Person>(Guid.Parse(id));
                 if (p != null)
                 {
                     CriteriaOperator criteria = new BinaryOperator("PersonId", p.PersonId, BinaryOperatorType.Equal);
                     XPCollection <DepartmentPerson> dpPersonCL = new XPCollection <DepartmentPerson>(session, criteria);
                     foreach (DepartmentPerson dpPerson in dpPersonCL)
                     {
                         if (dpPerson != null)
                         {
                             dpPerson.RowStatus = -1;
                             dpPerson.Save();
                         }
                     }
                     XPCollection <LoginAccount> lgAccountCL = new XPCollection <LoginAccount>(session, criteria);
                     foreach (LoginAccount lgAccount in lgAccountCL)
                     {
                         if (lgAccount != null)
                         {
                             lgAccount.RowStatus = -1;
                             lgAccount.Save();
                         }
                     }
                     p.RowStatus = -1;
                     p.Save();
                     loadListUsers(trlDepartmentMenu.FocusedNode);
                 }
             }
         }
     }
 }
 protected void grid_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     if (e.Parameters.Length != 0)
     {
         string portId = this.txt_Pod.Text;
         dsExportRef.FilterExpression = "StatusCode='USE'  and Pod='" + portId + "' and Etd >= '" + DateTime.Today.ToString("yyyy-MM-dd") + "'";
         this.grid_Sch.DataBind();
     }
 }
Beispiel #14
0
    protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        string    SCode = "";
        string    sql   = "SELECT STATION_CODE FROM CODE_STATION WHERE STATION_NAME='" + txtSName.Text.Trim().ToUpper() + "'";
        DataTable dt    = dc.GetTable(sql);

        if (dt.Rows.Count > 0)
        {
            SCode = dt.Rows[0][0].ToString();
        }
        string xlh     = dc.GetValue("select GET_FDJXL('" + txtSO.Text.ToUpper() + "') from dual");
        string Oldplan = txtPlanCode.Text.Trim();


        if (txtPCode.Text.Trim() != "")
        {
            if (txtPCode.Value.ToString() == "L")
            {
                string    sql2 = "select jhmcold from atpujhsn where jhmc='" + txtPlanCode.Text.Trim() + "'";
                DataTable dt2  = dc.GetTable(sql2);

                if (dt2.Rows.Count > 0)
                {
                    Oldplan = dt2.Rows[0][0].ToString();
                }
            }
            PL_QUERY_BOMZJTS_MWS sp = new PL_QUERY_BOMZJTS_MWS()
            {
                SO1          = txtSO.Text.Trim().ToUpper(),
                ZDDM1        = SCode,
                GZDD11       = txtPCode.Value.ToString(),
                FDJXL1       = xlh,
                JHDM1        = Oldplan,
                MACHINENAME1 = MachineName
            };
            Procedure.run(sp);
            PL_UPDATE_BOMZJTS_MWS sp2 = new PL_UPDATE_BOMZJTS_MWS()
            {
                SO1          = txtSO.Text.Trim().ToUpper(),
                ZDDM1        = SCode,
                JHDM1        = Oldplan,
                GZDD11       = txtPCode.Value.ToString(),
                MACHINENAME1 = MachineName
            };
            Procedure.run(sp2);
            PL_UPDATE_BOMSOTHTS_MWS sp3 = new PL_UPDATE_BOMSOTHTS_MWS()
            {
                SO1          = txtSO.Text.Trim().ToUpper(),
                ZDDM1        = SCode,
                JHDM1        = Oldplan,
                MACHINENAME1 = MachineName
            };
            Procedure.run(sp3);
        }
        setCondition();
        ASPxGridView1.Selection.UnselectAll();
    }
Beispiel #15
0
    protected void grid_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        string s = e.Parameters;

        if (s == "Save")
        {
            Save();
        }
    }
Beispiel #16
0
 protected void ASPxGridView4_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     //if (txtSN4.Text.Trim() == "")
     //{
     //    ASPxGridView4.JSProperties.Add("cpCallbackName", "Fail");
     //    ASPxGridView4.JSProperties.Add("cpCallbackRet", "请先输入流水号再进行查询!");
     //    return;
     //}
     //setCondition();
 }
Beispiel #17
0
        protected void gridOneReplace_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
        {
            string par = e.Parameters as string;

            string[] parstr   = par.Split(';');
            string   so       = parstr[0];
            string   planCode = parstr[1];

            initOneMaterialReplace(so, planCode, "0");
        }
Beispiel #18
0
 protected void ASPxGridView5_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     if (txtSN5.Text.Trim() == "")
     {
         ASPxGridView5.JSProperties.Add("cpCallbackName", "Fail");
         ASPxGridView5.JSProperties.Add("cpCallbackRet", "请先输入流水号再进行查询!");
         return;
     }
     setCondition();
 }
    protected void grid_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        string s = e.Parameters;

        if (s == "Save")
        {
            Save();
            this.txt_ContractNo.Text = Session["ContractWhere"].ToString();
        }
    }
Beispiel #20
0
 protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     if (txtSN.Text.Trim() == "" && ASPxDateEdit1.Text.Trim() == "" && ASPxDateEdit2.Text.Trim() == "" && txtItem.Text.Trim() == "" && txtGYS.Text.Trim() == "" && txtPC.Text.Trim() == "")
     {
         ASPxGridView1.JSProperties.Add("cpCallbackName", "Fail");
         ASPxGridView1.JSProperties.Add("cpCallbackRet", "请指定查询条件!");
         return;
     }
     setCondition();
     ASPxGridView1.Selection.UnselectAll();
 }
Beispiel #21
0
    void grid_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        string[] paramsArray = e.Parameters.Split('|');
        string   YG_OID      = paramsArray[0];
        string   OU_TYPE     = paramsArray[1];
        decimal  OU_NUM      = decimal.Parse(paramsArray[2]);
        string   OU_DESC     = paramsArray[3];

        ouAdapter.NewOutLayUse(YG_OID, OU_TYPE, OU_NUM, OU_DESC, AuthUser.UserID);
        grid.DataBind();
    }
Beispiel #22
0
 protected void gvPreViewData_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     try
     {
         var inq = this.Get_DefineSource();
         var ds  = (new MdxExecuter(GlobalVar.DbOLAP_ConnectionStr_Tiny)).ExecuteDataSet(inq.ToMDX());
         this.gvPreViewData.DataSource = ds;
         this.gvPreViewData.DataBind();
     }
     catch { }
 }
Beispiel #23
0
    protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        //if (txtICode.Text.Trim() == "")
        //{
        //    ASPxGridView1.JSProperties.Add("cpCallbackName", "Fail");
        //    ASPxGridView1.JSProperties.Add("cpCallbackRet", "请输入要查询的零件号!");
        //    return;

        //}
        setCondition();
    }
Beispiel #24
0
        protected void ASPxGridView2_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
        {
            string sql = "select a.ljdm1,b.pt_desc2 oldpart_name ,a.gwmc, a.ljdm2,c.pt_desc2 newpart_name,sl,a.gwmc1,a.gxmc1,a.rowid from SJBOMSOTHMUTI a"
                         + " left outer join copy_pt_mstr b on a.ljdm1=b.pt_part"
                         + " left outer join copy_pt_mstr c on a.ljdm2=c.pt_part"
                         + " where so='" + Request["so"].ToString() + "' and jhdm='" + Request["planCode"].ToString()
                         + "' and gzdd='" + Request["plineCode"].ToString() + "' and thgroup='" + cmbGroup.Text + "'";

            ASPxGridView2.DataSource = dc.GetTable(sql);
            ASPxGridView2.DataBind();
        }
Beispiel #25
0
 protected void dxgvPODetails_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     //string country = e.Parameters.ToString();
     //grid.Selection.UnselectAll();
     for (int i = 0; i < dxgvPODetails.VisibleRowCount; i++)
     {
         if (dxgvPODetails.GetRowValues(i, "BalanceAmount") != null)
         {
         }
     }
 }
 protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     //string s = e.Parameters;
     //int index = SafeValue.SafeInt(s, 0);
     //ASPxSpinEdit balanceAmt = this.ASPxGridView1.FindRowTemplateControl(index, "spin_BalanceAmt") as ASPxSpinEdit;
     //ASPxSpinEdit amt = this.ASPxGridView1.FindRowTemplateControl(index, "spin_Amt") as ASPxSpinEdit;
     //ASPxCheckBox isPay = this.ASPxGridView1.FindRowTemplateControl(index, "ack_IsPay") as ASPxCheckBox;
     //if (isPay.Checked)
     //    amt.Value = balanceAmt.Value;
     //else
     //    amt.Value = 0;
 }
Beispiel #27
0
    protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        ASPxGridView grid = sender as ASPxGridView;

        //Switch the grid to edit mode for the last selected row
        if (e.Parameters == "StartEditing")
        {
            object lastSelectedRowKeyValue     = grid.GetSelectedFieldValues("ID")[grid.Selection.Count - 1];
            int    lastSelectedRowVisibleIndex = grid.FindVisibleIndexByKeyValue(lastSelectedRowKeyValue);
            grid.StartEdit(lastSelectedRowVisibleIndex);
        }
    }
Beispiel #28
0
 protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
 {
     //string plancode = ASPxTextPlanCode.Text.Trim().ToUpper();
     //string sql = "select t.*,t.rowid  from ms_over_mat_log t where 1=1 ";
     //if (plancode != "")
     //{
     //    sql = sql + " and bill_code='DEL-" + plancode + "' ";
     //}
     //sql = sql + "order by MATERIAL_CODE";
     //DataTable dt = dc.GetTable(sql);
     //ASPxGridView1.DataSource = dt;
     //ASPxGridView1.DataBind();
 }
Beispiel #29
0
        protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
        {
            string sql = "select a.oldpart ,b.pt_desc2 oldpart_name, a.newpart ,c.pt_desc2 newpart_name,a.sl,d.location_code  from sjbomthset a"
                         + " left join copy_pt_mstr b on a.oldpart=b.pt_part"
                         + " left join copy_pt_mstr c on a.newpart=c.pt_part"
                         + " left join DATA_PLAN_STANDARD_BOM d on a.oldpart = d.item_code and plan_code='" + Request["planCode"].ToString() + "' "
                         + " where (so='" + Request["so"].ToString() + "' or so='" + thgxjx
                         + "') and settype='1' and usetime<=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd') and endtime>=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd') and thgroup='" + cmbGroup.Text + "'";

            //string sql = "select a.oldpart ,b.pt_desc2 oldpart_name, a.newpart ,c.pt_desc2 newpart_name,a.sl,d.location_code from vw_DATA_PLAN_STANDARD_BOM d where d.plan_so='SO42846' and d.plan_code='E20160918-01' and d.item_code in (select oldpart from sjbomthset where (so='" + Request["so"].ToString() + "' or so='" + thgxjx + "') and settype='1' and usetime<=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd') and endtime>=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd') )";
            gridMaterial.DataSource = dc.GetTable(sql);
            gridMaterial.DataBind();
        }
Beispiel #30
0
    protected void gridVinculoUsuario_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        //Apagar as linhas da grid
        //RemoverItensGrid(gridVinculoUsuario);

        if (coOperacaoVinculo.Value == "Alteracao" && e.Parameters != "" && e.Parameters != "Zerar")
        {
            //Altera Vinculo selecionado na grid
            AlteraVinculoUsuario(Convert.ToInt32(coIDUsuario.Value), Convert.ToInt32(cbSetor.Value), Convert.ToInt32(Session["IDEmpresa"]), Convert.ToInt32(coIDVinculoUsuario.Value),
                                 Convert.ToInt32(cbTPUsuario.Value), Convert.ToInt32(cbCargo.Value), 17, Convert.ToInt32(cbRegimeHora.Value), tbEntradaManha.Text.Trim(),
                                 tbSaidaManha.Text.Trim(), tbEntradaTarde.Text.Trim(), tbSaidaTarde.Text.Trim(), cbDashboard.Checked, cbCadastraDigital.Checked, Convert.ToInt32(cbStatus.Value));

            //Forçar a execução do botão Salvar -- Caso o usuário não clique no mesmo.
            coPermiteExecutar.Value = "True";
            coCPF.Value             = "True";
            btSalvar_Click(sender, e);

            PreenchegridVinculoUsuario(Convert.ToInt32(coIDUsuario.Value), Convert.ToInt32(coIDSetorVinculoUsuario["IDSetor"]), Convert.ToInt32(Session["IDEmpresa"]), Convert.ToInt32(Session["TPUsuario"]));
        }
        else if (coOperacaoVinculo.Value == "Inclusao" && coOperacao.Value != "Incluir")
        {
            CadastraVinculoUsuario(Convert.ToInt32(coIDUsuario.Value), Convert.ToInt32(cbSetor.Value), Convert.ToInt32(Session["IDEmpresa"]), 0,
                                   Convert.ToInt32(cbTPUsuario.Value), Convert.ToInt32(cbCargo.Value), 17, Convert.ToInt32(cbRegimeHora.Value), tbEntradaManha.Text.Trim(),
                                   tbSaidaManha.Text.Trim(), tbEntradaTarde.Text.Trim(), tbSaidaTarde.Text.Trim(), cbDashboard.Checked, cbCadastraDigital.Checked);

            //Forçar a execução do botão Salvar -- Caso o usuário não clique no mesmo.
            coPermiteExecutar.Value = "True";
            coCPF.Value             = "True";
            btSalvar_Click(sender, e);

            PreenchegridVinculoUsuario(Convert.ToInt32(coIDUsuario.Value), Convert.ToInt32(coIDSetorVinculoUsuario["IDSetor"]), Convert.ToInt32(Session["IDEmpresa"]), Convert.ToInt32(Session["TPUsuario"]));
        }
        else if (coOperacaoVinculo.Value == "Inclusao" && coOperacao.Value == "Incluir" && cbSetor.Text != "")
        {
            ds.vwVinculoUsuario.AddvwVinculoUsuarioRow(Convert.ToInt32(Session["IDEmpresa"]), "", "", 0, 0, Convert.ToInt32(cbSetor.Value), cbSetor.Text.Trim(), "",
                                                       cbTPUsuario.Text.ToString(), Convert.ToInt32(cbTPUsuario.Value), Convert.ToInt32(cbRegimeHora.Value), cbRegimeHora.Text.Trim(), "",
                                                       1, 0, Convert.ToInt32(tbTotHoras.Text), cbCadastraDigital.Checked, cbDashboard.Checked, tbSaidaTarde.Text, tbSaidaManha.Text, tbEntradaTarde.Text,
                                                       tbEntradaManha.Text, 17, Convert.ToInt32(cbCargo.Value), DateTime.Now, Convert.ToDateTime("1900-01-01"), cbCargo.Text, "CARREIRA/COMISSIONADO",
                                                       cbStatus.Text, tbPIS.Text.Trim(), cbDescontoTotalJornada.Checked, cbIsencaoPonto.Checked);

            PreenchegridVinculoUsuario(0, Convert.ToInt32(cbSetor.Value), Convert.ToInt32(Session["IDEmpresa"]), Convert.ToInt32(Session["TPUsuario"]));
        }
        else if (e.Parameters != "Zerar")
        {
            PreenchegridVinculoUsuario(Convert.ToInt32(coIDUsuario.Value), Convert.ToInt32(coIDSetorVinculoUsuario["IDSetor"]), Convert.ToInt32(Session["IDEmpresa"]), Convert.ToInt32(Session["TPUsuario"]));
        }
        else
        {
            PreenchegridVinculoUsuario(0, 0, 0, Convert.ToInt32(Session["TPUsuario"]));
        }
    }